diff --git a/gallery_dl/extractor/2chan.py b/gallery_dl/extractor/2chan.py index ed223ac8..12a81aac 100644 --- a/gallery_dl/extractor/2chan.py +++ b/gallery_dl/extractor/2chan.py @@ -27,7 +27,7 @@ class FutabaThreadExtractor(Extractor): }) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) url, self.server, self.board, self.thread = match.groups() self.url = "https://" + url + ".htm" diff --git a/gallery_dl/extractor/artstation.py b/gallery_dl/extractor/artstation.py index 7dbb196d..69184601 100644 --- a/gallery_dl/extractor/artstation.py +++ b/gallery_dl/extractor/artstation.py @@ -22,9 +22,9 @@ class ArtstationExtractor(Extractor): archive_fmt = "{asset[id]}" root = "https://www.artstation.com" - def __init__(self, match=None): - Extractor.__init__(self) - self.user = match.group(1) or match.group(2) if match else None + def __init__(self, match): + Extractor.__init__(self, match) + self.user = match.group(1) or match.group(2) self.external = self.config("external", False) def items(self): @@ -230,7 +230,7 @@ class ArtstationChallengeExtractor(ArtstationExtractor): ) def __init__(self, match): - ArtstationExtractor.__init__(self) + ArtstationExtractor.__init__(self, match) self.challenge_id = match.group(1) self.sorting = match.group(2) or "popular" @@ -277,7 +277,7 @@ class ArtstationSearchExtractor(ArtstationExtractor): test = ("https://www.artstation.com/search?sorting=recent&q=ancient",) def __init__(self, match): - ArtstationExtractor.__init__(self) + ArtstationExtractor.__init__(self, match) query = text.parse_query(match.group(1)) self.searchterm = query.get("q", "") self.order = query.get("sorting", "recent").lower() @@ -330,7 +330,7 @@ class ArtstationImageExtractor(ArtstationExtractor): ) def __init__(self, match): - ArtstationExtractor.__init__(self) + ArtstationExtractor.__init__(self, match) self.project_id = match.group(1) self.assets = None diff --git a/gallery_dl/extractor/behance.py b/gallery_dl/extractor/behance.py index ebc3df29..ea718193 100644 --- a/gallery_dl/extractor/behance.py +++ b/gallery_dl/extractor/behance.py @@ -70,7 +70,7 @@ class BehanceGalleryExtractor(BehanceExtractor): ) def __init__(self, match): - BehanceExtractor.__init__(self) + BehanceExtractor.__init__(self, match) self.gallery_id = match.group(1) def items(self): @@ -134,7 +134,7 @@ class BehanceUserExtractor(BehanceExtractor): }) def __init__(self, match): - BehanceExtractor.__init__(self) + BehanceExtractor.__init__(self, match) self.user = match.group(1) def galleries(self): @@ -162,7 +162,7 @@ class BehanceCollectionExtractor(BehanceExtractor): }) def __init__(self, match): - BehanceExtractor.__init__(self) + BehanceExtractor.__init__(self, match) self.collection_id = match.group(1) def galleries(self): diff --git a/gallery_dl/extractor/bobx.py b/gallery_dl/extractor/bobx.py index 70f114b7..5aebc6e7 100644 --- a/gallery_dl/extractor/bobx.py +++ b/gallery_dl/extractor/bobx.py @@ -18,6 +18,10 @@ class BobxExtractor(Extractor): root = "http://www.bobx.com" per_page = 80 + def __init__(self, match): + Extractor.__init__(self, match) + self.path = match.group(1) + class BobxGalleryExtractor(BobxExtractor): """Extractor for individual image galleries on bobx.com""" @@ -41,10 +45,6 @@ class BobxGalleryExtractor(BobxExtractor): }), ) - def __init__(self, match): - BobxExtractor.__init__(self) - self.path = match.group(1) - def items(self): num = 0 while True: @@ -97,12 +97,9 @@ class BobxIdolExtractor(BobxExtractor): "url": "74d80bfcd53b738b31909bb42e5cc97c41b475b8", }) - def __init__(self, match): - BobxExtractor.__init__(self) - self.url = "{}/{}/".format(self.root, match.group(1)) - def items(self): - page = self.request(self.url).text + url = "{}/{}/".format(self.root, self.path) + page = self.request(url).text skip = True yield Message.Version, 1 @@ -111,4 +108,4 @@ class BobxIdolExtractor(BobxExtractor): skip = not skip if skip: continue - yield Message.Queue, "{}photoset/{}".format(self.url, part), {} + yield Message.Queue, "{}photoset/{}".format(url, part), {} diff --git a/gallery_dl/extractor/booru.py b/gallery_dl/extractor/booru.py index 57d3f30e..2eeb85fe 100644 --- a/gallery_dl/extractor/booru.py +++ b/gallery_dl/extractor/booru.py @@ -29,7 +29,7 @@ class BooruExtractor(SharedConfigMixin, Extractor): sort = False def __init__(self, match): - super().__init__() + super().__init__(match) self.params = {} self.extags = self.post_url and self.config("tags", False) @@ -87,7 +87,7 @@ class BooruExtractor(SharedConfigMixin, Extractor): return {} def extended_tags(self, image, page=None): - """Rerieve extended tag information""" + """Retrieve extended tag information""" if not page: url = self.post_url.format(image["id"]) page = self.request(url).text diff --git a/gallery_dl/extractor/chan.py b/gallery_dl/extractor/chan.py index 4e0830da..5e44fd9e 100644 --- a/gallery_dl/extractor/chan.py +++ b/gallery_dl/extractor/chan.py @@ -23,7 +23,7 @@ class ChanThreadExtractor(Extractor): file_url = "" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.metadata = { "board": match.group(1), "thread": match.group(2), diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 907a1346..eb411fc9 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -31,7 +31,7 @@ class Extractor(): archive_fmt = "" cookiedomain = "" - def __init__(self): + def __init__(self, match): self.session = requests.Session() self.log = logging.getLogger(self.category) self._set_headers() @@ -208,8 +208,8 @@ class ChapterExtractor(Extractor): archive_fmt = ( "{manga}_{chapter}{chapter_minor}_{page}") - def __init__(self, url): - Extractor.__init__(self) + def __init__(self, match, url): + Extractor.__init__(self, match) self.url = url def items(self): @@ -256,7 +256,7 @@ class MangaExtractor(Extractor): reverse = True def __init__(self, match, url=None): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = url or self.scheme + "://" + match.group(1) if self.config("chapter-reverse", False): diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index be1f78a3..50ae9a5d 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -34,12 +34,12 @@ class DeviantartExtractor(Extractor): root = "https://www.deviantart.com" def __init__(self, match=None): - Extractor.__init__(self) + Extractor.__init__(self, match) self.api = DeviantartAPI(self) self.offset = 0 self.flat = self.config("flat", True) self.original = self.config("original", True) - self.user = match.group(1) or match.group(2) if match else None + self.user = match.group(1) or match.group(2) self.group = False self.commit_journal = { @@ -482,8 +482,9 @@ class DeviantartPopularExtractor(DeviantartExtractor): ) def __init__(self, match): - DeviantartExtractor.__init__(self) + DeviantartExtractor.__init__(self, match) self.search_term = self.time_range = self.category_path = None + self.user = "" path, trange, query = match.groups() if path: diff --git a/gallery_dl/extractor/directlink.py b/gallery_dl/extractor/directlink.py index d45b6208..07e75e78 100644 --- a/gallery_dl/extractor/directlink.py +++ b/gallery_dl/extractor/directlink.py @@ -38,7 +38,7 @@ class DirectlinkExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.data = match.groupdict() self.url = match.string diff --git a/gallery_dl/extractor/dynastyscans.py b/gallery_dl/extractor/dynastyscans.py index 22d891c7..3600515c 100644 --- a/gallery_dl/extractor/dynastyscans.py +++ b/gallery_dl/extractor/dynastyscans.py @@ -35,7 +35,7 @@ class DynastyscansChapterExtractor(ChapterExtractor): def __init__(self, match): self.chaptername = match.group(1) url = self.root + "/chapters/" + self.chaptername - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): """Collect metadata for extractor-job""" diff --git a/gallery_dl/extractor/exhentai.py b/gallery_dl/extractor/exhentai.py index 9f5a0ebe..633faadf 100644 --- a/gallery_dl/extractor/exhentai.py +++ b/gallery_dl/extractor/exhentai.py @@ -30,8 +30,8 @@ class ExhentaiExtractor(Extractor): cookienames = ("ipb_member_id", "ipb_pass_hash") root = "https://exhentai.org" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.limits = self.config("limits", True) self.original = self.config("original", True) self.wait_min = self.config("wait-min", 3) @@ -126,7 +126,7 @@ class ExhentaiGalleryExtractor(ExhentaiExtractor): ) def __init__(self, match): - ExhentaiExtractor.__init__(self) + ExhentaiExtractor.__init__(self, match) self.key = {} self.count = 0 self.gallery_id = text.parse_int(match.group(2) or match.group(5)) @@ -337,7 +337,7 @@ class ExhentaiSearchExtractor(ExhentaiExtractor): ) def __init__(self, match): - ExhentaiExtractor.__init__(self) + ExhentaiExtractor.__init__(self, match) self.params = text.parse_query(match.group(1) or "") self.params["page"] = text.parse_int(self.params.get("page")) self.url = self.root diff --git a/gallery_dl/extractor/fallenangels.py b/gallery_dl/extractor/fallenangels.py index 05e34f80..62d2caca 100644 --- a/gallery_dl/extractor/fallenangels.py +++ b/gallery_dl/extractor/fallenangels.py @@ -36,7 +36,7 @@ class FallenangelsChapterExtractor(ChapterExtractor): self.version, self.manga, self.chapter, self.minor = match.groups() url = "https://{}.fascans.com/manga/{}/{}/1".format( self.version, self.manga, self.chapter) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): lang = "vi" if self.version == "truyen" else "en" diff --git a/gallery_dl/extractor/flickr.py b/gallery_dl/extractor/flickr.py index 55327052..fac9deb2 100644 --- a/gallery_dl/extractor/flickr.py +++ b/gallery_dl/extractor/flickr.py @@ -18,7 +18,7 @@ class FlickrExtractor(Extractor): filename_fmt = "{category}_{id}.{extension}" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.api = FlickrAPI(self) self.item_id = match.group(1) self.user = None diff --git a/gallery_dl/extractor/foolfuuka.py b/gallery_dl/extractor/foolfuuka.py index 64cb7c29..9c9b2d0b 100644 --- a/gallery_dl/extractor/foolfuuka.py +++ b/gallery_dl/extractor/foolfuuka.py @@ -26,7 +26,7 @@ class FoolfuukaThreadExtractor(SharedConfigMixin, Extractor): root = "" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.board, self.thread = match.groups() self.session.headers["Referer"] = self.root diff --git a/gallery_dl/extractor/foolslide.py b/gallery_dl/extractor/foolslide.py index d03a46f0..84fdbe75 100644 --- a/gallery_dl/extractor/foolslide.py +++ b/gallery_dl/extractor/foolslide.py @@ -46,7 +46,7 @@ class FoolslideChapterExtractor(FoolslideBase, Extractor): decode = "default" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = self.root + match.group(1) def items(self): diff --git a/gallery_dl/extractor/gfycat.py b/gallery_dl/extractor/gfycat.py index e58971a1..1dcb3c8e 100644 --- a/gallery_dl/extractor/gfycat.py +++ b/gallery_dl/extractor/gfycat.py @@ -18,8 +18,8 @@ class GfycatExtractor(Extractor): archive_fmt = "{gfyName}" root = "https://gfycat.com" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.formats = (self.config("format", "mp4"), "mp4", "webm", "gif") def _select_format(self, gfyitem): @@ -73,7 +73,7 @@ class GfycatImageExtractor(GfycatExtractor): ) def __init__(self, match): - GfycatExtractor.__init__(self) + GfycatExtractor.__init__(self, match) self.gfycat_id = match.group(1) def items(self): diff --git a/gallery_dl/extractor/hbrowse.py b/gallery_dl/extractor/hbrowse.py index 8556c0ed..90c9de34 100644 --- a/gallery_dl/extractor/hbrowse.py +++ b/gallery_dl/extractor/hbrowse.py @@ -86,7 +86,7 @@ class HbrowseChapterExtractor(HbrowseBase, ChapterExtractor): def __init__(self, match): self.gid, self.chapter = match.groups() self.path = "/{}/c{}/".format(self.gid, self.chapter) - ChapterExtractor.__init__(self, self.root + self.path) + ChapterExtractor.__init__(self, match, self.root + self.path) def get_metadata(self, page): return self.parse_page(page, { diff --git a/gallery_dl/extractor/hentai2read.py b/gallery_dl/extractor/hentai2read.py index 41730541..06f977ac 100644 --- a/gallery_dl/extractor/hentai2read.py +++ b/gallery_dl/extractor/hentai2read.py @@ -69,7 +69,7 @@ class Hentai2readChapterExtractor(ChapterExtractor): def __init__(self, match): url_title, self.chapter = match.groups() url = "https://hentai2read.com/{}/{}/".format(url_title, self.chapter) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): title, pos = text.extract(page, "", "") diff --git a/gallery_dl/extractor/hentaifoundry.py b/gallery_dl/extractor/hentaifoundry.py index 0f12e250..fe3ae42a 100644 --- a/gallery_dl/extractor/hentaifoundry.py +++ b/gallery_dl/extractor/hentaifoundry.py @@ -21,8 +21,8 @@ class HentaifoundryExtractor(Extractor): root = "https://www.hentai-foundry.com" per_page = 25 - def __init__(self, user="", page=1): - Extractor.__init__(self) + def __init__(self, match, user="", page=1): + Extractor.__init__(self, match) self.url = "" self.user = user self.start_post = 0 @@ -134,7 +134,7 @@ class HentaifoundryUserExtractor(HentaifoundryExtractor): def __init__(self, match): HentaifoundryExtractor.__init__( - self, match.group(1) or match.group(3), match.group(2)) + self, match, match.group(1) or match.group(3), match.group(2)) self.url = "{}/pictures/user/{}".format(self.root, self.user) def get_job_metadata(self): @@ -159,7 +159,8 @@ class HentaifoundryScrapsExtractor(HentaifoundryExtractor): ) def __init__(self, match): - HentaifoundryExtractor.__init__(self, match.group(1), match.group(2)) + HentaifoundryExtractor.__init__( + self, match, match.group(1), match.group(2)) self.url = "{}/pictures/user/{}/scraps".format(self.root, self.user) def get_job_metadata(self): @@ -185,7 +186,8 @@ class HentaifoundryFavoriteExtractor(HentaifoundryExtractor): ) def __init__(self, match): - HentaifoundryExtractor.__init__(self, match.group(1), match.group(2)) + HentaifoundryExtractor.__init__( + self, match, match.group(1), match.group(2)) self.url = "{}/user/{}/faves/pictures".format(self.root, self.user) @@ -199,7 +201,7 @@ class HentaifoundryRecentExtractor(HentaifoundryExtractor): test = ("http://www.hentai-foundry.com/pictures/recent/2018-09-20",) def __init__(self, match): - HentaifoundryExtractor.__init__(self, "", match.group(2)) + HentaifoundryExtractor.__init__(self, match, "", match.group(2)) self.date = match.group(1) self.url = "{}/pictures/recent/{}".format(self.root, self.date) @@ -218,7 +220,7 @@ class HentaifoundryPopularExtractor(HentaifoundryExtractor): test = ("http://www.hentai-foundry.com/pictures/popular",) def __init__(self, match): - HentaifoundryExtractor.__init__(self, "", match.group(1)) + HentaifoundryExtractor.__init__(self, match, "", match.group(1)) self.url = self.root + "/pictures/popular" @@ -242,7 +244,7 @@ class HentaifoundryImageExtractor(HentaifoundryExtractor): ) def __init__(self, match): - HentaifoundryExtractor.__init__(self, match.group(1)) + HentaifoundryExtractor.__init__(self, match, match.group(1)) self.index = match.group(2) def items(self): diff --git a/gallery_dl/extractor/hentaifox.py b/gallery_dl/extractor/hentaifox.py index 92da32bf..e5cf5650 100644 --- a/gallery_dl/extractor/hentaifox.py +++ b/gallery_dl/extractor/hentaifox.py @@ -30,7 +30,7 @@ class HentaifoxGalleryExtractor(ChapterExtractor): def __init__(self, match): self.gallery_id = match.group(1) url = "{}/gallery/{}".format(self.root, self.gallery_id) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): title, pos = text.extract(page, "

", "

") @@ -84,7 +84,7 @@ class HentaifoxSearchExtractor(Extractor): root = "https://hentaifox.com" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.path = match.group(1) def items(self): diff --git a/gallery_dl/extractor/hentaihere.py b/gallery_dl/extractor/hentaihere.py index fcf8a996..0a63baef 100644 --- a/gallery_dl/extractor/hentaihere.py +++ b/gallery_dl/extractor/hentaihere.py @@ -70,7 +70,7 @@ class HentaihereChapterExtractor(ChapterExtractor): self.manga_id, self.chapter = match.groups() url = "https://hentaihere.com/m/S{}/{}/1".format( self.manga_id, self.chapter) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): title = text.extract(page, "", "")[0] diff --git a/gallery_dl/extractor/hitomi.py b/gallery_dl/extractor/hitomi.py index ce80c00b..505c0d6e 100644 --- a/gallery_dl/extractor/hitomi.py +++ b/gallery_dl/extractor/hitomi.py @@ -36,7 +36,7 @@ class HitomiGalleryExtractor(ChapterExtractor): def __init__(self, match): self.gid = text.parse_int(match.group(1)) url = "https://hitomi.la/galleries/{}.html".format(self.gid) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page, extr=text.extract): pos = page.index('

', "")[0] diff --git a/gallery_dl/extractor/luscious.py b/gallery_dl/extractor/luscious.py index 2dafb58b..adeaed9a 100644 --- a/gallery_dl/extractor/luscious.py +++ b/gallery_dl/extractor/luscious.py @@ -71,7 +71,7 @@ class LusciousAlbumExtractor(AsynchronousMixin, LusciousExtractor): ) def __init__(self, match): - LusciousExtractor.__init__(self) + LusciousExtractor.__init__(self, match) self.gpart, self.gid = match.groups() def items(self): @@ -160,7 +160,7 @@ class LusciousSearchExtractor(LusciousExtractor): ) def __init__(self, match): - LusciousExtractor.__init__(self) + LusciousExtractor.__init__(self, match) self.path = match.group(1).partition("/page/")[0] if not self.path.startswith("albums/"): self.path = "albums/" + self.path diff --git a/gallery_dl/extractor/mangadex.py b/gallery_dl/extractor/mangadex.py index 8fdab976..d32bded1 100644 --- a/gallery_dl/extractor/mangadex.py +++ b/gallery_dl/extractor/mangadex.py @@ -61,7 +61,7 @@ class MangadexChapterExtractor(MangadexExtractor): ) def __init__(self, match): - MangadexExtractor.__init__(self) + MangadexExtractor.__init__(self, match) self.chapter_id = match.group(1) self.data = None @@ -139,7 +139,7 @@ class MangadexMangaExtractor(MangadexExtractor): ) def __init__(self, match): - MangadexExtractor.__init__(self) + MangadexExtractor.__init__(self, match) self.manga_id = text.parse_int(match.group(1)) def items(self): diff --git a/gallery_dl/extractor/mangafox.py b/gallery_dl/extractor/mangafox.py index b994d084..f1291096 100644 --- a/gallery_dl/extractor/mangafox.py +++ b/gallery_dl/extractor/mangafox.py @@ -29,7 +29,7 @@ class MangafoxChapterExtractor(ChapterExtractor): def __init__(self, match): base, self.cstr, self.volume, self.chapter, self.minor = match.groups() self.urlbase = self.root + base - ChapterExtractor.__init__(self, self.urlbase + "/1.html") + ChapterExtractor.__init__(self, match, self.urlbase + "/1.html") def get_metadata(self, page): manga, pos = text.extract(page, "", "") diff --git a/gallery_dl/extractor/mangahere.py b/gallery_dl/extractor/mangahere.py index 6deb3cba..5b4a2a9e 100644 --- a/gallery_dl/extractor/mangahere.py +++ b/gallery_dl/extractor/mangahere.py @@ -94,7 +94,8 @@ class MangahereChapterExtractor(MangahereBase, ChapterExtractor): def __init__(self, match): self.part, self.volume, self.chapter = match.groups() - ChapterExtractor.__init__(self, self.url_fmt.format(self.part, 1)) + url = self.url_fmt.format(self.part, 1) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): """Collect metadata for extractor-job""" diff --git a/gallery_dl/extractor/mangapark.py b/gallery_dl/extractor/mangapark.py index 3e95a41b..b0eaaf06 100644 --- a/gallery_dl/extractor/mangapark.py +++ b/gallery_dl/extractor/mangapark.py @@ -103,7 +103,7 @@ class MangaparkChapterExtractor(MangaparkBase, ChapterExtractor): tld, self.path = match.groups() self.root = self.root_fmt.format(tld) url = "{}/manga/{}?zoom=2".format(self.root, self.path) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): data = text.extract_all(page, ( diff --git a/gallery_dl/extractor/mangareader.py b/gallery_dl/extractor/mangareader.py index 55ecdec7..ed922116 100644 --- a/gallery_dl/extractor/mangareader.py +++ b/gallery_dl/extractor/mangareader.py @@ -69,7 +69,7 @@ class MangareaderChapterExtractor(MangareaderBase, ChapterExtractor): def __init__(self, match): self.part, self.url_title, self.chapter = match.groups() - ChapterExtractor.__init__(self, self.root + self.part) + ChapterExtractor.__init__(self, match, self.root + self.part) def get_metadata(self, chapter_page): """Collect metadata for extractor-job""" diff --git a/gallery_dl/extractor/mangastream.py b/gallery_dl/extractor/mangastream.py index 8b075b7e..57a878fc 100644 --- a/gallery_dl/extractor/mangastream.py +++ b/gallery_dl/extractor/mangastream.py @@ -27,7 +27,7 @@ class MangastreamChapterExtractor(ChapterExtractor): def __init__(self, match): self.part, self.chapter, self.chapter_id = match.groups() url = "{}/r/{}".format(self.root, self.part) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): manga, pos = text.extract( diff --git a/gallery_dl/extractor/mastodon.py b/gallery_dl/extractor/mastodon.py index cde8eb28..28a2c2d8 100644 --- a/gallery_dl/extractor/mastodon.py +++ b/gallery_dl/extractor/mastodon.py @@ -23,7 +23,7 @@ class MastodonExtractor(Extractor): root = None def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.api = MastodonAPI(self) def config(self, key, default=None, *, sentinel=object()): diff --git a/gallery_dl/extractor/myportfolio.py b/gallery_dl/extractor/myportfolio.py index 6f12b3d8..1d543db3 100644 --- a/gallery_dl/extractor/myportfolio.py +++ b/gallery_dl/extractor/myportfolio.py @@ -36,7 +36,7 @@ class MyportfolioGalleryExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.domain = match.group(1) or match.group(2) self.gallery = match.group(3) @@ -98,7 +98,7 @@ class MyportfolioUserExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.domain = match.group(1) or match.group(2) self.prefix = "myportfolio:" if match.group(1) else "" diff --git a/gallery_dl/extractor/newgrounds.py b/gallery_dl/extractor/newgrounds.py index 19417e11..e1302668 100644 --- a/gallery_dl/extractor/newgrounds.py +++ b/gallery_dl/extractor/newgrounds.py @@ -21,7 +21,7 @@ class NewgroundsExtractor(Extractor): archive_fmt = "{index}" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.user = match.group(1) self.root = "https://{}.newgrounds.com".format(self.user) diff --git a/gallery_dl/extractor/ngomik.py b/gallery_dl/extractor/ngomik.py index bba743a5..1f315821 100644 --- a/gallery_dl/extractor/ngomik.py +++ b/gallery_dl/extractor/ngomik.py @@ -25,7 +25,7 @@ class NgomikChapterExtractor(ChapterExtractor): def __init__(self, match): url = "{}/{}".format(self.root, match.group(1)) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): info = text.extract(page, '', "")[0] diff --git a/gallery_dl/extractor/nhentai.py b/gallery_dl/extractor/nhentai.py index ffa76587..756f2d4b 100644 --- a/gallery_dl/extractor/nhentai.py +++ b/gallery_dl/extractor/nhentai.py @@ -49,7 +49,7 @@ class NhentaiGalleryExtractor(NHentaiExtractor): }) def __init__(self, match): - NHentaiExtractor.__init__(self) + NHentaiExtractor.__init__(self, match) self.gid = match.group(1) def items(self): @@ -86,7 +86,7 @@ class NhentaiSearchExtractor(NHentaiExtractor): }) def __init__(self, match): - NHentaiExtractor.__init__(self) + NHentaiExtractor.__init__(self, match) self.params = text.parse_query(match.group(1)) def items(self): diff --git a/gallery_dl/extractor/nijie.py b/gallery_dl/extractor/nijie.py index bc9fdfb6..0129ea53 100644 --- a/gallery_dl/extractor/nijie.py +++ b/gallery_dl/extractor/nijie.py @@ -25,10 +25,10 @@ class NijieExtractor(AsynchronousMixin, Extractor): view_url = "https://nijie.info/view.php?id=" popup_url = "https://nijie.info/view_popup.php?id=" - def __init__(self, match=None): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) + self.user_id = match.group(1) self.session.headers["Referer"] = self.root + "/" - self.user_id = match.group(1) if match else None def items(self): self.login() @@ -185,7 +185,7 @@ class NijieImageExtractor(NijieExtractor): ) def __init__(self, match): - NijieExtractor.__init__(self) + NijieExtractor.__init__(self, match) self.image_id = match.group(1) self.page = "" diff --git a/gallery_dl/extractor/oauth.py b/gallery_dl/extractor/oauth.py index 2ef5b284..51b22149 100644 --- a/gallery_dl/extractor/oauth.py +++ b/gallery_dl/extractor/oauth.py @@ -22,7 +22,7 @@ class OAuthBase(Extractor): redirect_uri = "http://localhost:6414/" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.client = None def oauth_config(self, key, default=None): diff --git a/gallery_dl/extractor/paheal.py b/gallery_dl/extractor/paheal.py index 1e1ddb06..9337b8d5 100644 --- a/gallery_dl/extractor/paheal.py +++ b/gallery_dl/extractor/paheal.py @@ -52,7 +52,7 @@ class PahealTagExtractor(PahealExtractor): per_page = 70 def __init__(self, match): - PahealExtractor.__init__(self) + PahealExtractor.__init__(self, match) self.tags = text.unquote(match.group(1)) def get_metadata(self): @@ -101,7 +101,7 @@ class PahealPostExtractor(PahealExtractor): }) def __init__(self, match): - PahealExtractor.__init__(self) + PahealExtractor.__init__(self, match) self.post_id = match.group(1) def get_posts(self): diff --git a/gallery_dl/extractor/photobucket.py b/gallery_dl/extractor/photobucket.py index 71de01fa..c18b4026 100644 --- a/gallery_dl/extractor/photobucket.py +++ b/gallery_dl/extractor/photobucket.py @@ -48,7 +48,7 @@ class PhotobucketAlbumExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.album_path = "" self.url = match.group(0) self.root = "http://" + match.group(1) @@ -127,7 +127,7 @@ class PhotobucketImageExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = match.group(0) self.user = match.group(1) or match.group(3) self.media_id = match.group(2) diff --git a/gallery_dl/extractor/piczel.py b/gallery_dl/extractor/piczel.py index 71ff4176..6a5c41c4 100644 --- a/gallery_dl/extractor/piczel.py +++ b/gallery_dl/extractor/piczel.py @@ -22,7 +22,7 @@ class PiczelExtractor(Extractor): api_root = "https://apollo.piczel.tv" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.item_id = match.group(1) def items(self): diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py index 0cd8ec4d..fa8cd48d 100644 --- a/gallery_dl/extractor/pinterest.py +++ b/gallery_dl/extractor/pinterest.py @@ -22,8 +22,8 @@ class PinterestExtractor(Extractor): filename_fmt = "{category}_{id}.{extension}" archive_fmt = "{id}" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.api = PinterestAPI(self) def items(self): @@ -70,7 +70,7 @@ class PinterestPinExtractor(PinterestExtractor): ) def __init__(self, match): - PinterestExtractor.__init__(self) + PinterestExtractor.__init__(self, match) self.pin_id = match.group(1) self.pin = None @@ -99,7 +99,7 @@ class PinterestBoardExtractor(PinterestExtractor): ) def __init__(self, match): - PinterestExtractor.__init__(self) + PinterestExtractor.__init__(self, match) self.user = text.unquote(match.group(1)) self.board = text.unquote(match.group(2)) self.board_id = 0 @@ -161,7 +161,7 @@ class PinterestPinitExtractor(PinterestExtractor): ) def __init__(self, match): - PinterestExtractor.__init__(self) + PinterestExtractor.__init__(self, match) self.shortened_id = match.group(1) def items(self): diff --git a/gallery_dl/extractor/pixiv.py b/gallery_dl/extractor/pixiv.py index 0ca52481..a68455d7 100644 --- a/gallery_dl/extractor/pixiv.py +++ b/gallery_dl/extractor/pixiv.py @@ -21,8 +21,8 @@ class PixivExtractor(Extractor): filename_fmt = "{category}_{user[id]}_{id}{num}.{extension}" archive_fmt = "{id}{num}.{extension}" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.api = PixivAppAPI(self) self.user_id = -1 self.load_ugoira = self.config("ugoira", True) @@ -105,7 +105,7 @@ class PixivUserExtractor(PixivExtractor): ) def __init__(self, match): - PixivExtractor.__init__(self) + PixivExtractor.__init__(self, match) self.user_id = match.group(1) or match.group(3) self.query = text.parse_query(match.group(2)) @@ -136,7 +136,7 @@ class PixivMeExtractor(PixivExtractor): ) def __init__(self, match): - PixivExtractor.__init__(self) + PixivExtractor.__init__(self, match) self.account = match.group(1) def items(self): @@ -183,7 +183,7 @@ class PixivWorkExtractor(PixivExtractor): ) def __init__(self, match): - PixivExtractor.__init__(self) + PixivExtractor.__init__(self, match) self.illust_id = match.group(1) or match.group(2) self.load_ugoira = True self.work = None @@ -223,7 +223,7 @@ class PixivFavoriteExtractor(PixivExtractor): ) def __init__(self, match): - PixivExtractor.__init__(self) + PixivExtractor.__init__(self, match) self.query = text.parse_query(match.group(1)) if "id" not in self.query: self.subcategory = "bookmark" @@ -265,7 +265,7 @@ class PixivRankingExtractor(PixivExtractor): ) def __init__(self, match): - PixivExtractor.__init__(self) + PixivExtractor.__init__(self, match) self.query = match.group(1) self.mode = self.date = None @@ -325,7 +325,7 @@ class PixivSearchExtractor(PixivExtractor): ) def __init__(self, match): - PixivExtractor.__init__(self) + PixivExtractor.__init__(self, match) self.query = match.group(1) self.word = self.sort = self.target = None @@ -381,9 +381,6 @@ class PixivFollowExtractor(PixivExtractor): ("https://touch.pixiv.net/bookmark_new_illust.php"), ) - def __init__(self, _): - PixivExtractor.__init__(self) - def works(self): return self.api.illust_follow() diff --git a/gallery_dl/extractor/reactor.py b/gallery_dl/extractor/reactor.py index 30ce8a42..a7769f1a 100644 --- a/gallery_dl/extractor/reactor.py +++ b/gallery_dl/extractor/reactor.py @@ -26,7 +26,7 @@ class ReactorExtractor(SharedConfigMixin, Extractor): archive_fmt = "{post_id}_{num}" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = match.group(0) self.root = "http://" + match.group(1) self.session.headers["Referer"] = self.root diff --git a/gallery_dl/extractor/readcomiconline.py b/gallery_dl/extractor/readcomiconline.py index 5574721b..f03936d7 100644 --- a/gallery_dl/extractor/readcomiconline.py +++ b/gallery_dl/extractor/readcomiconline.py @@ -76,7 +76,7 @@ class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor): }) def __init__(self, match): - ChapterExtractor.__init__(self, self.root + match.group(1)) + ChapterExtractor.__init__(self, match, self.root + match.group(1)) self.issue_id = match.group(2) def get_metadata(self, page): diff --git a/gallery_dl/extractor/recursive.py b/gallery_dl/extractor/recursive.py index 14f096dc..27922797 100644 --- a/gallery_dl/extractor/recursive.py +++ b/gallery_dl/extractor/recursive.py @@ -23,7 +23,7 @@ class RecursiveExtractor(Extractor): }) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.session.mount("file://", FileAdapter()) self.url = match.group(1) diff --git a/gallery_dl/extractor/reddit.py b/gallery_dl/extractor/reddit.py index 69fe5b37..88ede387 100644 --- a/gallery_dl/extractor/reddit.py +++ b/gallery_dl/extractor/reddit.py @@ -19,8 +19,8 @@ class RedditExtractor(Extractor): """Base class for reddit extractors""" category = "reddit" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.api = RedditAPI(self) self.max_depth = int(self.config("recursion", 0)) self._visited = set() @@ -90,7 +90,7 @@ class RedditSubredditExtractor(RedditExtractor): ) def __init__(self, match): - RedditExtractor.__init__(self) + RedditExtractor.__init__(self, match) self.subreddit, self.order, self.timeframe = match.groups() def submissions(self): @@ -117,7 +117,7 @@ class RedditSubmissionExtractor(RedditExtractor): ) def __init__(self, match): - RedditExtractor.__init__(self) + RedditExtractor.__init__(self, match) self.submission_id = match.group(1) def submissions(self): @@ -144,7 +144,7 @@ class RedditImageExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = match.group(0) def items(self): diff --git a/gallery_dl/extractor/sankaku.py b/gallery_dl/extractor/sankaku.py index b6236653..2c47930e 100644 --- a/gallery_dl/extractor/sankaku.py +++ b/gallery_dl/extractor/sankaku.py @@ -26,8 +26,8 @@ class SankakuExtractor(SharedConfigMixin, Extractor): cookiedomain = "chan.sankakucomplex.com" subdomain = "chan" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.root = "https://" + self.cookiedomain self.logged_in = True self.start_page = 1 @@ -174,7 +174,7 @@ class SankakuTagExtractor(SankakuExtractor): per_page = 20 def __init__(self, match): - SankakuExtractor.__init__(self) + SankakuExtractor.__init__(self, match) query = text.parse_query(match.group(1)) self.tags = text.unquote(query.get("tags", "").replace("+", " ")) self.start_page = text.parse_int(query.get("page"), 1) @@ -241,7 +241,7 @@ class SankakuPoolExtractor(SankakuExtractor): per_page = 24 def __init__(self, match): - SankakuExtractor.__init__(self) + SankakuExtractor.__init__(self, match) self.pool_id = match.group(1) def skip(self, num): @@ -287,7 +287,7 @@ class SankakuPostExtractor(SankakuExtractor): }) def __init__(self, match): - SankakuExtractor.__init__(self) + SankakuExtractor.__init__(self, match) self.post_id = match.group(1) def get_posts(self): diff --git a/gallery_dl/extractor/seiga.py b/gallery_dl/extractor/seiga.py index e2b16ac6..eebf23a5 100644 --- a/gallery_dl/extractor/seiga.py +++ b/gallery_dl/extractor/seiga.py @@ -19,8 +19,8 @@ class SeigaExtractor(Extractor): archive_fmt = "{image_id}" cookiedomain = ".nicovideo.jp" - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.start_image = 0 def items(self): @@ -100,7 +100,7 @@ class SeigaUserExtractor(SeigaExtractor): ) def __init__(self, match): - SeigaExtractor.__init__(self) + SeigaExtractor.__init__(self, match) self.user_id, self.order = match.groups() self.start_page = 1 @@ -186,7 +186,7 @@ class SeigaImageExtractor(SeigaExtractor): ) def __init__(self, match): - SeigaExtractor.__init__(self) + SeigaExtractor.__init__(self, match) self.image_id = match.group(1) def skip(self, num): diff --git a/gallery_dl/extractor/senmanga.py b/gallery_dl/extractor/senmanga.py index f822968d..a1734783 100644 --- a/gallery_dl/extractor/senmanga.py +++ b/gallery_dl/extractor/senmanga.py @@ -34,7 +34,7 @@ class SenmangaChapterExtractor(Extractor): root = "https://raw.senmanga.com" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) part = match.group(1) self.chapter_url = "{}/{}/".format(self.root, part) self.img_url = "{}/viewer/{}/".format(self.root, part) diff --git a/gallery_dl/extractor/simplyhentai.py b/gallery_dl/extractor/simplyhentai.py index 58e1e730..389cd089 100644 --- a/gallery_dl/extractor/simplyhentai.py +++ b/gallery_dl/extractor/simplyhentai.py @@ -39,7 +39,7 @@ class SimplyhentaiGalleryExtractor(ChapterExtractor): def __init__(self, match): url = "https://" + match.group(1) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) self.session.headers["Referer"] = url def get_metadata(self, page): @@ -99,7 +99,7 @@ class SimplyhentaiImageExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = "https://www." + match.group(1) self.type = match.group(2) @@ -153,7 +153,7 @@ class SimplyhentaiVideoExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.url = "https://" + match.group(1) def items(self): diff --git a/gallery_dl/extractor/slideshare.py b/gallery_dl/extractor/slideshare.py index 42ad04df..30420a8b 100644 --- a/gallery_dl/extractor/slideshare.py +++ b/gallery_dl/extractor/slideshare.py @@ -40,7 +40,7 @@ class SlidesharePresentationExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.user, self.presentation = match.groups() def items(self): diff --git a/gallery_dl/extractor/smugmug.py b/gallery_dl/extractor/smugmug.py index 109a2e29..ae99eb5a 100644 --- a/gallery_dl/extractor/smugmug.py +++ b/gallery_dl/extractor/smugmug.py @@ -33,8 +33,8 @@ class SmugmugExtractor(Extractor): "Uris": None, } - def __init__(self): - Extractor.__init__(self) + def __init__(self, match): + Extractor.__init__(self, match) self.api = SmugmugAPI(self) @staticmethod @@ -69,7 +69,7 @@ class SmugmugAlbumExtractor(SmugmugExtractor): ) def __init__(self, match): - SmugmugExtractor.__init__(self) + SmugmugExtractor.__init__(self, match) self.album_id = match.group(1) def items(self): @@ -109,7 +109,7 @@ class SmugmugImageExtractor(SmugmugExtractor): ) def __init__(self, match): - SmugmugExtractor.__init__(self) + SmugmugExtractor.__init__(self, match) self.image_id = match.group(3) def items(self): @@ -153,7 +153,7 @@ class SmugmugPathExtractor(SmugmugExtractor): ) def __init__(self, match): - SmugmugExtractor.__init__(self) + SmugmugExtractor.__init__(self, match) self.domain, self.user, self.path = match.groups() def items(self): diff --git a/gallery_dl/extractor/test.py b/gallery_dl/extractor/test.py index 9227343f..2f4992c3 100644 --- a/gallery_dl/extractor/test.py +++ b/gallery_dl/extractor/test.py @@ -40,7 +40,7 @@ class TestExtractor(Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) categories, subcategories, indices = match.groups() self.categories = self._split(categories) self.subcategories = self._split(subcategories) diff --git a/gallery_dl/extractor/tsumino.py b/gallery_dl/extractor/tsumino.py index 6157577c..6c8a9d35 100644 --- a/gallery_dl/extractor/tsumino.py +++ b/gallery_dl/extractor/tsumino.py @@ -78,7 +78,7 @@ class TsuminoGalleryExtractor(TsuminoBase, ChapterExtractor): def __init__(self, match): self.gallery_id = match.group(1) url = "{}/Book/Info/{}".format(self.root, self.gallery_id) - ChapterExtractor.__init__(self, url) + ChapterExtractor.__init__(self, match, url) def get_metadata(self, page): extr = text.extract @@ -155,7 +155,7 @@ class TsuminoSearchExtractor(TsuminoBase, Extractor): ) def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.query = match.group(1) def items(self): diff --git a/gallery_dl/extractor/tumblr.py b/gallery_dl/extractor/tumblr.py index cec9e2d4..cecf0a9f 100644 --- a/gallery_dl/extractor/tumblr.py +++ b/gallery_dl/extractor/tumblr.py @@ -47,7 +47,7 @@ class TumblrExtractor(Extractor): archive_fmt = "{id}_{num}" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.blog = match.group(1) or match.group(2) self.api = TumblrAPI(self) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index f0780a3f..a8cbcbdb 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -21,7 +21,7 @@ class TwitterExtractor(Extractor): root = "https://twitter.com" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.user = match.group(1) self.retweets = self.config("retweets", True) self.videos = self.config("videos", False) diff --git a/gallery_dl/extractor/wallhaven.py b/gallery_dl/extractor/wallhaven.py index 510238f4..c3f54ef9 100644 --- a/gallery_dl/extractor/wallhaven.py +++ b/gallery_dl/extractor/wallhaven.py @@ -98,7 +98,7 @@ class WallhavenSearchExtractor(WallhavenExtractor): per_page = 24 def __init__(self, match): - WallhavenExtractor.__init__(self) + WallhavenExtractor.__init__(self, match) self.params = text.parse_query(match.group(1)) def items(self): @@ -164,7 +164,7 @@ class WallhavenImageExtractor(WallhavenExtractor): ) def __init__(self, match): - WallhavenExtractor.__init__(self) + WallhavenExtractor.__init__(self, match) self.wallpaper_id = match.group(1) def items(self): diff --git a/gallery_dl/extractor/warosu.py b/gallery_dl/extractor/warosu.py index ec6ca5b2..d3531448 100644 --- a/gallery_dl/extractor/warosu.py +++ b/gallery_dl/extractor/warosu.py @@ -34,7 +34,7 @@ class WarosuThreadExtractor(Extractor): root = "https://warosu.org" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.board, self.thread = match.groups() def items(self): diff --git a/gallery_dl/extractor/xvideos.py b/gallery_dl/extractor/xvideos.py index d7a0bfd8..dd6f6294 100644 --- a/gallery_dl/extractor/xvideos.py +++ b/gallery_dl/extractor/xvideos.py @@ -44,7 +44,7 @@ class XvideosGalleryExtractor(XvideosExtractor): ) def __init__(self, match): - XvideosExtractor.__init__(self) + XvideosExtractor.__init__(self, match) self.user, self.gid = match.groups() self.url = "https://www.xvideos.com/profiles/{}/photos/{}".format( self.user, self.gid) @@ -108,7 +108,7 @@ class XvideosUserExtractor(XvideosExtractor): ) def __init__(self, match): - XvideosExtractor.__init__(self) + XvideosExtractor.__init__(self, match) self.user = match.group(1) self.url = "https://www.xvideos.com/profiles/" + self.user diff --git a/gallery_dl/extractor/yuki.py b/gallery_dl/extractor/yuki.py index 18d49f4c..0844c404 100644 --- a/gallery_dl/extractor/yuki.py +++ b/gallery_dl/extractor/yuki.py @@ -44,7 +44,7 @@ class YukiThreadExtractor(Extractor): root = "https://yuki.la" def __init__(self, match): - Extractor.__init__(self) + Extractor.__init__(self, match) self.board, self.thread = match.groups() def items(self): diff --git a/test/test_extractor.py b/test/test_extractor.py index a47d6df5..080fc581 100644 --- a/test/test_extractor.py +++ b/test/test_extractor.py @@ -21,9 +21,6 @@ class FakeExtractor(Extractor): subcategory = "test" pattern = "fake:" - def __init__(self, match=None): - Extractor.__init__(self) - def items(self): yield Message.Version, 1 yield Message.Url, "text:foobar", {}