From 1d2b5d0c609610b8a60fec66e617659e90d5c848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 6 Sep 2023 18:16:09 +0200 Subject: [PATCH] update test comment positions always put them above the test they're referring to --- gallery_dl/extractor/deviantart.py | 3 +- gallery_dl/extractor/imagehosts.py | 9 +++-- gallery_dl/extractor/imgur.py | 63 ++++++++++++++++++++---------- gallery_dl/extractor/keenspot.py | 17 +++++--- gallery_dl/extractor/mangadex.py | 4 +- gallery_dl/extractor/pixnet.py | 6 +-- gallery_dl/extractor/reactor.py | 15 ++++--- gallery_dl/extractor/tapas.py | 5 ++- gallery_dl/extractor/tumblr.py | 24 ++++++++---- 9 files changed, 95 insertions(+), 51 deletions(-) diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 3302afbe..1cca967e 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -693,8 +693,9 @@ class DeviantartFavoriteExtractor(DeviantartExtractor): archive_fmt = "f_{_username}_{index}.{extension}" pattern = BASE_PATTERN + r"/favourites(?:/all|/?\?catpath=)?/?$" test = ( + # (#271) ("https://www.deviantart.com/h3813067/favourites/", { - "options": (("metadata", True), ("flat", False)), # issue #271 + "options": (("metadata", True), ("flat", False)), "count": 1, }), ("https://www.deviantart.com/h3813067/favourites/", { diff --git a/gallery_dl/extractor/imagehosts.py b/gallery_dl/extractor/imagehosts.py index 0f782e8f..93dfa3e4 100644 --- a/gallery_dl/extractor/imagehosts.py +++ b/gallery_dl/extractor/imagehosts.py @@ -75,7 +75,8 @@ class ImxtoImageExtractor(ImagehostImageExtractor): pattern = (r"(?:https?://)?(?:www\.)?((?:imx\.to|img\.yt)" r"/(?:i/|img-)(\w+)(\.html)?)") test = ( - ("https://imx.to/i/1qdeva", { # new-style URL + # new-style URL + ("https://imx.to/i/1qdeva", { "url": "ab2173088a6cdef631d7a47dec4a5da1c6a00130", "content": "0c8768055e4e20e7c7259608b67799171b691140", "keyword": { @@ -85,7 +86,8 @@ class ImxtoImageExtractor(ImagehostImageExtractor): "hash" : "94d56c599223c59f3feb71ea603484d1", }, }), - ("https://imx.to/img-57a2050547b97.html", { # old-style URL + # old-style URL + ("https://imx.to/img-57a2050547b97.html", { "url": "a83fe6ef1909a318c4d49fcf2caf62f36c3f9204", "content": "54592f2635674c25677c6872db3709d343cdf92f", "keyword": { @@ -95,7 +97,8 @@ class ImxtoImageExtractor(ImagehostImageExtractor): "hash" : "40da6aaa7b8c42b18ef74309bbc713fc", }, }), - ("https://img.yt/img-57a2050547b97.html", { # img.yt domain + # img.yt domain + ("https://img.yt/img-57a2050547b97.html", { "url": "a83fe6ef1909a318c4d49fcf2caf62f36c3f9204", }), ("https://imx.to/img-57a2050547b98.html", { diff --git a/gallery_dl/extractor/imgur.py b/gallery_dl/extractor/imgur.py index ca9671c3..fd29a0e2 100644 --- a/gallery_dl/extractor/imgur.py +++ b/gallery_dl/extractor/imgur.py @@ -104,29 +104,42 @@ class ImgurImageExtractor(ImgurExtractor): "width" : 64, }, }), - ("http://imgur.com/0gybAXR", { # gifv/mp4 video + # gifv/mp4 video + ("http://imgur.com/0gybAXR", { "url": "a2220eb265a55b0c95e0d3d721ec7665460e3fd7", "content": "a3c080e43f58f55243ab830569ba02309d59abfc", }), - ("https://imgur.com/XFfsmuC", { # missing title in API response (#467) + # missing title in API response (#467) + ("https://imgur.com/XFfsmuC", { "keyword": {"title": "Tears are a natural response to irritants"}, }), - ("https://imgur.com/1Nily2P", { # animated png + # animated png + ("https://imgur.com/1Nily2P", { "pattern": "https://i.imgur.com/1Nily2P.png", }), - ("https://imgur.com/zzzzzzz", { # not found + # not found + ("https://imgur.com/zzzzzzz", { "exception": exception.HttpError, }), ("https://m.imgur.com/r/Celebs/iHJ7tsM"), - ("https://www.imgur.com/21yMxCS"), # www - ("https://m.imgur.com/21yMxCS"), # mobile - ("https://imgur.com/zxaY6"), # 5 character key - ("https://imgur.io/zxaY6"), # .io - ("https://i.imgur.com/21yMxCS.png"), # direct link - ("https://i.imgur.io/21yMxCS.png"), # direct link .io - ("https://i.imgur.com/21yMxCSh.png"), # direct link thumbnail - ("https://i.imgur.com/zxaY6.gif"), # direct link (short) - ("https://i.imgur.com/zxaY6s.gif"), # direct link (short; thumb) + # www + ("https://www.imgur.com/21yMxCS"), + # mobile + ("https://m.imgur.com/21yMxCS"), + # 5 character key + ("https://imgur.com/zxaY6"), + # .io + ("https://imgur.io/zxaY6"), + # direct link + ("https://i.imgur.com/21yMxCS.png"), + # direct link .io + ("https://i.imgur.io/21yMxCS.png"), + # direct link thumbnail + ("https://i.imgur.com/21yMxCSh.png"), + # direct link (short) + ("https://i.imgur.com/zxaY6.gif"), + # direct link (short; thumb) + ("https://i.imgur.com/zxaY6s.gif"), ) def items(self): @@ -201,21 +214,27 @@ class ImgurAlbumExtractor(ImgurExtractor): "width" : int, }, }), - ("https://imgur.com/a/eD9CT", { # large album + # large album + ("https://imgur.com/a/eD9CT", { "url": "de748c181a04d18bef1de9d4f4866ef0a06d632b", }), - ("https://imgur.com/a/RhJXhVT/all", { # 7 character album hash + # 7 character album hash + ("https://imgur.com/a/RhJXhVT/all", { "url": "695ef0c950023362a0163ee5041796300db76674", }), ("https://imgur.com/a/TcBmQ", { "exception": exception.HttpError, }), - ("https://imgur.com/a/pjOnJA0", { # empty, no 'media' (#2557) + # empty, no 'media' (#2557) + ("https://imgur.com/a/pjOnJA0", { "count": 0, }), - ("https://www.imgur.com/a/TcBmP"), # www - ("https://imgur.io/a/TcBmP"), # .io - ("https://m.imgur.com/a/TcBmP"), # mobile + # www + ("https://www.imgur.com/a/TcBmP"), + # .io + ("https://imgur.io/a/TcBmP"), + # mobile + ("https://m.imgur.com/a/TcBmP"), ) def items(self): @@ -250,7 +269,8 @@ class ImgurGalleryExtractor(ImgurExtractor): subcategory = "gallery" pattern = BASE_PATTERN + r"/(?:gallery|t/\w+)/(\w{7}|\w{5})" test = ( - ("https://imgur.com/gallery/zf2fIms", { # non-album gallery (#380) + # non-album gallery (#380) + ("https://imgur.com/gallery/zf2fIms", { "pattern": "https://imgur.com/zf2fIms", }), ("https://imgur.com/gallery/eD9CT", { @@ -258,7 +278,8 @@ class ImgurGalleryExtractor(ImgurExtractor): }), ("https://imgur.com/t/unmuted/26sEhNr"), ("https://imgur.com/t/cat/qSB8NbN"), - ("https://imgur.io/t/cat/qSB8NbN"), # .io + # .io + ("https://imgur.io/t/cat/qSB8NbN"), ) def items(self): diff --git a/gallery_dl/extractor/keenspot.py b/gallery_dl/extractor/keenspot.py index b5d77380..78454a6f 100644 --- a/gallery_dl/extractor/keenspot.py +++ b/gallery_dl/extractor/keenspot.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2019 Mike Fährmann +# Copyright 2019-2023 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -21,23 +21,28 @@ class KeenspotComicExtractor(Extractor): archive_fmt = "{comic}_{filename}" pattern = r"(?:https?://)?(?!www\.|forums\.)([\w-]+)\.keenspot\.com(/.+)?" test = ( - ("http://marksmen.keenspot.com/", { # link + # link + ("http://marksmen.keenspot.com/", { "range": "1-3", "url": "83bcf029103bf8bc865a1988afa4aaeb23709ba6", }), - ("http://barkercomic.keenspot.com/", { # id + # id + ("http://barkercomic.keenspot.com/", { "range": "1-3", "url": "c4080926db18d00bac641fdd708393b7d61379e6", }), - ("http://crowscare.keenspot.com/", { # id v2 + # id v2 + ("http://crowscare.keenspot.com/", { "range": "1-3", "url": "a00e66a133dd39005777317da90cef921466fcaa" }), - ("http://supernovas.keenspot.com/", { # ks + # ks + ("http://supernovas.keenspot.com/", { "range": "1-3", "url": "de21b12887ef31ff82edccbc09d112e3885c3aab" }), - ("http://twokinds.keenspot.com/comic/1066/", { # "random" access + # "random" access + ("http://twokinds.keenspot.com/comic/1066/", { "range": "1-3", "url": "6a784e11370abfb343dcad9adbb7718f9b7be350", }) diff --git a/gallery_dl/extractor/mangadex.py b/gallery_dl/extractor/mangadex.py index e12e56b4..e82ac91a 100644 --- a/gallery_dl/extractor/mangadex.py +++ b/gallery_dl/extractor/mangadex.py @@ -112,9 +112,9 @@ class MangadexChapterExtractor(MangadexExtractor): ("https://mangadex.org/chapter/74149a55-e7c4-44ea-8a37-98e879c1096f", { "exception": exception.StopExtraction, }), - # 'externalUrl', but still downloadable (#2503) + # 'externalUrl', but still downloadable / 404 (#2503) ("https://mangadex.org/chapter/364728a4-6909-4164-9eea-6b56354f7c78", { - "count": 0, # 404 + "count": 0, }), ) diff --git a/gallery_dl/extractor/pixnet.py b/gallery_dl/extractor/pixnet.py index 15be5635..7a5009cf 100644 --- a/gallery_dl/extractor/pixnet.py +++ b/gallery_dl/extractor/pixnet.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2016-2020 Mike Fährmann +# Copyright 2016-2023 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -11,7 +11,6 @@ from .common import Extractor, Message from .. import text, exception - BASE_PATTERN = r"(?:https?://)?(?!www\.)([\w-]+)\.pixnet.net" @@ -109,8 +108,9 @@ class PixnetSetExtractor(PixnetExtractor): "url": "b3eb6431aea0bcf5003432a4a0f3a3232084fc13", "keyword": "bf7004faa1cea18cf9bd856f0955a69be51b1ec6", }), + # password-protected ("https://sky92100.pixnet.net/album/set/17492544", { - "count": 0, # password-protected + "count": 0, }), ) diff --git a/gallery_dl/extractor/reactor.py b/gallery_dl/extractor/reactor.py index ba571bbd..d10c412b 100644 --- a/gallery_dl/extractor/reactor.py +++ b/gallery_dl/extractor/reactor.py @@ -265,27 +265,32 @@ class ReactorPostExtractor(ReactorExtractor): "url": "dfc74d150d7267384d8c229c4b82aa210755daa0", }), ("http://anime.reactor.cc/post/3576250"), - ("http://joyreactor.com/post/3721876", { # single image + # single image + ("http://joyreactor.com/post/3721876", { "pattern": r"http://img\d\.joyreactor\.com/pics/post/full" r"/cartoon-painting-monster-lake-4841316.jpeg", "count": 1, "keyword": "2207a7dfed55def2042b6c2554894c8d7fda386e", }), - ("http://joyreactor.com/post/3713804", { # 4 images + # 4 images + ("http://joyreactor.com/post/3713804", { "pattern": r"http://img\d\.joyreactor\.com/pics/post/full" r"/movie-tv-godzilla-monsters-\d+\.jpeg", "count": 4, "keyword": "d7da9ba7809004c809eedcf6f1c06ad0fbb3df21", }), - ("http://joyreactor.com/post/3726210", { # gif / video + # gif / video + ("http://joyreactor.com/post/3726210", { "url": "60f3b9a0a3918b269bea9b4f8f1a5ab3c2c550f8", "keyword": "8949d9d5fc469dab264752432efbaa499561664a", }), - ("http://joyreactor.com/post/3668724", { # youtube embed + # youtube embed + ("http://joyreactor.com/post/3668724", { "url": "bf1666eddcff10c9b58f6be63fa94e4e13074214", "keyword": "e18b1ffbd79d76f9a0e90b6d474cc2499e343f0b", }), - ("http://joyreactor.cc/post/1299", { # "malformed" JSON + # "malformed" JSON + ("http://joyreactor.cc/post/1299", { "url": "ab02c6eb7b4035ad961b29ee0770ee41be2fcc39", }), ("http://pornreactor.cc/post/863166", { diff --git a/gallery_dl/extractor/tapas.py b/gallery_dl/extractor/tapas.py index 0e09e22a..53338e9a 100644 --- a/gallery_dl/extractor/tapas.py +++ b/gallery_dl/extractor/tapas.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2021-2022 Mike Fährmann +# Copyright 2021-2023 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -112,7 +112,8 @@ class TapasSeriesExtractor(TapasExtractor): "pattern": r"https://\w+\.cloudfront\.net/pc/\w\w/[0-9a-f-]+\.jpg", "count": 132, }), - ("https://tapas.io/series/yona", { # mature + # mature + ("https://tapas.io/series/yona", { "count": 26, }), ) diff --git a/gallery_dl/extractor/tumblr.py b/gallery_dl/extractor/tumblr.py index 9adc3ab1..e8c99294 100644 --- a/gallery_dl/extractor/tumblr.py +++ b/gallery_dl/extractor/tumblr.py @@ -287,23 +287,28 @@ class TumblrUserExtractor(TumblrExtractor): "count": 3, "options": (("posts", "all"), ("external", True)) }), - ("https://mikf123-hidden.tumblr.com/", { # dashboard-only + # dashboard-only + ("https://mikf123-hidden.tumblr.com/", { "options": (("access-token", None),), "exception": exception.AuthorizationError, }), - ("https://mikf123-hidden.tumblr.com/", { # dashboard-only + # dashboard-only + ("https://mikf123-hidden.tumblr.com/", { "count": 2, "keyword": {"tags": ["test", "hidden"]}, }), - ("https://mikf123-private.tumblr.com/", { # password protected + # password protected + ("https://mikf123-private.tumblr.com/", { "count": 2, "keyword": {"tags": ["test", "private"]}, }), - ("https://mikf123-private-hidden.tumblr.com/", { # both + # dashboard-only & password protected + ("https://mikf123-private-hidden.tumblr.com/", { "count": 2, "keyword": {"tags": ["test", "private", "hidden"]}, }), - ("https://mikf123.tumblr.com/", { # date-min/-max/-format (#337) + # date-min/-max/-format (#337) + ("https://mikf123.tumblr.com/", { "count": 4, "options": (("date-min", "201804"), ("date-max", "201805"), ("date-format", "%Y%m")) @@ -362,12 +367,14 @@ class TumblrPostExtractor(TumblrExtractor): ("https://mikf123.tumblr.com/post/181022380064/chat-post", { "count": 0, }), + # high-quality images (#1846) ("https://kichatundk.tumblr.com/post/654953419288821760", { - "count": 2, # high-quality images (#1846) + "count": 2, "content": "d6fcc7b6f750d835d55c7f31fa3b63be26c9f89b", }), + # high-quality images (#1344) ("https://hameru-is-cool.tumblr.com/post/639261855227002880", { - "count": 2, # high-quality images (#1344) + "count": 2, "content": "6bc19a42787e46e1bba2ef4aeef5ca28fcd3cd34", }), ("https://mikf123.tumblr.com/image/689860196535762944", { @@ -376,8 +383,9 @@ class TumblrPostExtractor(TumblrExtractor): r"/8f1131551cef6e74-bc/s99999x99999" r"/188cf9b8915b0d0911c6c743d152fc62e8f38491\.png$", }), + # HTML response (#297) ("http://ziemniax.tumblr.com/post/109697912859/", { - "exception": exception.NotFoundError, # HTML response (#297) + "exception": exception.NotFoundError, }), ("http://demo.tumblr.com/image/459265350"), ("https://www.tumblr.com/blog/view/smarties-art/686047436641353728"),