From 95338ff0ec32b15120c8f5d7de47d0be93d34573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 30 Jun 2025 12:10:57 +0200 Subject: [PATCH] replace 'result' with 'results' for lists more consistent names --- gallery_dl/extractor/common.py | 6 +++--- gallery_dl/extractor/deviantart.py | 4 +--- gallery_dl/extractor/hitomi.py | 6 +++--- gallery_dl/extractor/mangaread.py | 6 +++--- gallery_dl/extractor/telegraph.py | 6 +++--- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index e206e687..84a18b3f 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -880,15 +880,15 @@ class Dispatch(): elif isinstance(include, str): include = include.replace(" ", "").split(",") - result = [(Message.Version, 1)] + results = [(Message.Version, 1)] for category in include: try: extr, url = extractors[category] except KeyError: self.log.warning("Invalid include '%s'", category) else: - result.append((Message.Queue, url, {"_extractor": extr})) - return iter(result) + results.append((Message.Queue, url, {"_extractor": extr})) + return iter(results) class AsynchronousMixin(): diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index af0704ab..b66cd256 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -1882,9 +1882,7 @@ class DeviantartOAuthAPI(): params["offset"] = int(params["offset"]) + len(results) def _pagination_list(self, endpoint, params, key="results"): - result = [] - result.extend(self._pagination(endpoint, params, False, key=key)) - return result + return list(self._pagination(endpoint, params, False, key=key)) def _shared_content(self, results): """Return an iterable of shared deviations in 'results'""" diff --git a/gallery_dl/extractor/hitomi.py b/gallery_dl/extractor/hitomi.py index 0c2fa9bf..03b412ce 100644 --- a/gallery_dl/extractor/hitomi.py +++ b/gallery_dl/extractor/hitomi.py @@ -80,7 +80,7 @@ class HitomiGalleryExtractor(HitomiExtractor, GalleryExtractor): fmt = ext = self.config("format") or "webp" check = (fmt != "webp") - result = [] + results = [] for image in self.info["files"]: if check: ext = fmt if image.get("has" + fmt) else "webp" @@ -93,8 +93,8 @@ class HitomiGalleryExtractor(HitomiExtractor, GalleryExtractor): inum = int(ihash[-1] + ihash[-3:-1], 16) url = (f"https://{ext[0]}{gg_m.get(inum, gg_default) + 1}." f"{self.domain}/{gg_b}/{inum}/{ihash}.{ext}") - result.append((url, idata)) - return result + results.append((url, idata)) + return results class HitomiTagExtractor(HitomiExtractor): diff --git a/gallery_dl/extractor/mangaread.py b/gallery_dl/extractor/mangaread.py index 8bd54bfa..a3bdf392 100644 --- a/gallery_dl/extractor/mangaread.py +++ b/gallery_dl/extractor/mangaread.py @@ -63,14 +63,14 @@ class MangareadMangaExtractor(MangareadBase, MangaExtractor): if 'class="error404' in page: raise exception.NotFoundError("manga") data = self.metadata(page) - result = [] + results = [] for chapter in text.extract_iter( page, '
  • "): url , pos = text.extract(chapter, '", "", pos) self.parse_chapter_string(info, data) - result.append((url, data.copy())) - return result + results.append((url, data.copy())) + return results def metadata(self, page): extr = text.extract_from(text.extr( diff --git a/gallery_dl/extractor/telegraph.py b/gallery_dl/extractor/telegraph.py index 468840b2..2713621b 100644 --- a/gallery_dl/extractor/telegraph.py +++ b/gallery_dl/extractor/telegraph.py @@ -44,7 +44,7 @@ class TelegraphGalleryExtractor(GalleryExtractor): num_zeroes = len(str(len(figures))) num = 0 - result = [] + results = [] for figure in figures: url, pos = text.extract(figure, 'src="', '"') if url.startswith("/embed/"): @@ -54,10 +54,10 @@ class TelegraphGalleryExtractor(GalleryExtractor): caption, pos = text.extract(figure, "
    ", "<", pos) num += 1 - result.append((url, { + results.append((url, { "url" : url, "caption" : text.unescape(caption) if caption else "", "num" : num, "num_formatted": str(num).zfill(num_zeroes), })) - return result + return results