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, "