diff --git a/gallery_dl/extractor/behance.py b/gallery_dl/extractor/behance.py index 42bbaf1d..1ed89934 100644 --- a/gallery_dl/extractor/behance.py +++ b/gallery_dl/extractor/behance.py @@ -145,9 +145,7 @@ class BehanceGalleryExtractor(BehanceExtractor): raise exception.AuthorizationError() return () - result = [] - append = result.append - + results = [] for module in data["modules"]: mtype = module["__typename"][:-6].lower() @@ -165,7 +163,7 @@ class BehanceGalleryExtractor(BehanceExtractor): sizes.get("fs") or sizes.get("hd") or sizes.get("disp")) - append((size["url"], module)) + results.append((size["url"], module)) elif mtype == "video": try: @@ -177,7 +175,7 @@ class BehanceGalleryExtractor(BehanceExtractor): url = "ytdl:" + url module["_ytdl_manifest"] = "hls" module["extension"] = "mp4" - append((url, module)) + results.append((url, module)) continue except Exception as exc: self.log.debug("%s: %s", exc.__class__.__name__, exc) @@ -198,7 +196,7 @@ class BehanceGalleryExtractor(BehanceExtractor): self.log.debug("%s: %s", exc.__class__.__name__, exc) url = "ytdl:" + renditions[-1]["url"] - append((url, module)) + results.append((url, module)) elif mtype == "mediacollection": for component in module["components"]: @@ -206,7 +204,7 @@ class BehanceGalleryExtractor(BehanceExtractor): if size: parts = size["url"].split("/") parts[4] = "source" - append(("/".join(parts), module)) + results.append(("/".join(parts), module)) break elif mtype == "embed": @@ -214,13 +212,13 @@ class BehanceGalleryExtractor(BehanceExtractor): if embed: embed = text.unescape(text.extr(embed, 'src="', '"')) module["extension"] = "mp4" - append(("ytdl:" + embed, module)) + results.append(("ytdl:" + embed, module)) elif mtype == "text": module["extension"] = "txt" - append(("text:" + module["text"], module)) + results.append(("text:" + module["text"], module)) - return result + return results class BehanceUserExtractor(BehanceExtractor): diff --git a/gallery_dl/extractor/e621.py b/gallery_dl/extractor/e621.py index 1a5d8374..48e83a2c 100644 --- a/gallery_dl/extractor/e621.py +++ b/gallery_dl/extractor/e621.py @@ -109,12 +109,11 @@ class E621PoolExtractor(E621Extractor, danbooru.DanbooruPoolExtractor): } posts = [] - append = posts.append for num, pid in enumerate(self.post_ids, 1): if pid in id_to_post: post = id_to_post[pid] post["num"] = num - append(post) + posts.append(post) else: self.log.warning("Post %s is unavailable", pid) return posts diff --git a/gallery_dl/extractor/kemono.py b/gallery_dl/extractor/kemono.py index 38e2ae2e..3b5d3b92 100644 --- a/gallery_dl/extractor/kemono.py +++ b/gallery_dl/extractor/kemono.py @@ -428,15 +428,14 @@ class KemonoDiscordExtractor(KemonoExtractor): for post in posts: files = [] - append = files.append for attachment in post["attachments"]: match = find_hash(attachment["path"]) attachment["hash"] = match[1] if match else "" attachment["type"] = "attachment" - append(attachment) + files.append(attachment) for path in find_inline(post["content"] or ""): - append({"path": "https://cdn.discordapp.com" + path, - "name": path, "type": "inline", "hash": ""}) + files.append({"path": "https://cdn.discordapp.com" + path, + "name": path, "type": "inline", "hash": ""}) post.update(data) post["date"] = self._parse_datetime(post["published"]) diff --git a/gallery_dl/extractor/nitter.py b/gallery_dl/extractor/nitter.py index fbb65050..ceb44ab9 100644 --- a/gallery_dl/extractor/nitter.py +++ b/gallery_dl/extractor/nitter.py @@ -45,8 +45,6 @@ class NitterExtractor(BaseExtractor): attachments = tweet.pop("_attach", "") if attachments: files = [] - append = files.append - for url in text.extract_iter( attachments, 'href="', '"'): @@ -66,12 +64,12 @@ class NitterExtractor(BaseExtractor): file = {"url": url, "_http_retry": _retry_on_404} file["filename"], _, file["extension"] = \ name.rpartition(".") - append(file) + files.append(file) if videos and not files: if ytdl: url = f"ytdl:{self.root}/i/status/{tweet['tweet_id']}" - append({"url": url, "extension": "mp4"}) + files.append({"url": url, "extension": "mp4"}) else: for url in text.extract_iter( attachments, 'data-url="', '"'): @@ -84,7 +82,7 @@ class NitterExtractor(BaseExtractor): if url[0] == "/": url = self.root + url - append({ + files.append({ "url" : "ytdl:" + url, "filename" : name.rpartition(".")[0], "extension": "mp4", @@ -94,7 +92,8 @@ class NitterExtractor(BaseExtractor): attachments, '