propagate 'match' to base extractor constructor

This commit is contained in:
Mike Fährmann 2019-02-11 13:31:10 +01:00
parent ade86da7a1
commit 4b1880fa5e
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
70 changed files with 150 additions and 155 deletions

View File

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

View File

@ -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

View File

@ -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):

View File

@ -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), {}

View File

@ -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

View File

@ -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),

View File

@ -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):

View File

@ -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:

View File

@ -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

View File

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

View File

@ -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

View File

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

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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):

View File

@ -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, {

View File

@ -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, "<title>", "</title>")

View File

@ -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):

View File

@ -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, "<h1>", "</h1>")
@ -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):

View File

@ -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, "<title>", "</title>")[0]

View File

@ -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('<h1><a href="/reader/')

View File

@ -46,7 +46,7 @@ class ImagebamGalleryExtractor(ImagebamExtractor):
)
def __init__(self, match):
ImagebamExtractor.__init__(self)
ImagebamExtractor.__init__(self, match)
self.gallery_key = match.group(1)
def items(self):
@ -99,7 +99,7 @@ class ImagebamImageExtractor(ImagebamExtractor):
)
def __init__(self, match):
ImagebamExtractor.__init__(self)
ImagebamExtractor.__init__(self, match)
self.image_key = match.group(1)
def items(self):

View File

@ -41,7 +41,7 @@ class ImagefapGalleryExtractor(ImagefapExtractor):
)
def __init__(self, match):
ImagefapExtractor.__init__(self)
ImagefapExtractor.__init__(self, match)
self.gid = match.group(1)
self.image_id = ""
@ -101,7 +101,7 @@ class ImagefapImageExtractor(ImagefapExtractor):
})
def __init__(self, match):
ImagefapExtractor.__init__(self)
ImagefapExtractor.__init__(self, match)
self.image_id = match.group(1)
def items(self):
@ -147,7 +147,7 @@ class ImagefapUserExtractor(ImagefapExtractor):
)
def __init__(self, match):
ImagefapExtractor.__init__(self)
ImagefapExtractor.__init__(self, match)
self.user, self.user_id = match.groups()
def items(self):

View File

@ -26,7 +26,7 @@ class ImagehostImageExtractor(SharedConfigMixin, Extractor):
encoding = None
def __init__(self, match):
Extractor.__init__(self)
Extractor.__init__(self, match)
self.url = ("https://" if self.https else "http://") + match.group(1)
self.token = match.group(2)
if self.params == "simple":

View File

@ -81,7 +81,7 @@ class ImgboxGalleryExtractor(AsynchronousMixin, ImgboxExtractor):
)
def __init__(self, match):
ImgboxExtractor.__init__(self)
ImgboxExtractor.__init__(self, match)
self.gallery_key = match.group(1)
self.image_keys = []
@ -120,7 +120,7 @@ class ImgboxImageExtractor(ImgboxExtractor):
)
def __init__(self, match):
ImgboxExtractor.__init__(self)
ImgboxExtractor.__init__(self, match)
self.image_key = match.group(1)
def get_image_keys(self):

View File

@ -26,7 +26,7 @@ class ImgthGalleryExtractor(Extractor):
})
def __init__(self, match):
Extractor.__init__(self)
Extractor.__init__(self, match)
self.gid = match.group(1)
self.url = "https://imgth.com/gallery/" + self.gid + "/g/page/"

View File

@ -18,7 +18,7 @@ class ImgurExtractor(Extractor):
category = "imgur"
def __init__(self, match):
Extractor.__init__(self)
Extractor.__init__(self, match)
self.item_id = match.group(1)
self.mp4 = self.config("mp4", True)

View File

@ -164,7 +164,7 @@ class InstagramImageExtractor(InstagramExtractor):
)
def __init__(self, match):
InstagramExtractor.__init__(self)
InstagramExtractor.__init__(self, match)
self.shortcode = match.group(1)
def instagrams(self):
@ -182,7 +182,7 @@ class InstagramUserExtractor(InstagramExtractor):
})
def __init__(self, match):
InstagramExtractor.__init__(self)
InstagramExtractor.__init__(self, match)
self.username = match.group(1)
def instagrams(self):

View File

@ -30,7 +30,7 @@ class KhinsiderSoundtrackExtractor(AsynchronousMixin, Extractor):
root = "https://downloads.khinsider.com"
def __init__(self, match):
Extractor.__init__(self)
Extractor.__init__(self, match)
self.album = match.group(1)
def items(self):

View File

@ -127,7 +127,7 @@ class KissmangaChapterExtractor(KissmangaBase, ChapterExtractor):
)
def __init__(self, match):
ChapterExtractor.__init__(self, self.root + match.group(1))
ChapterExtractor.__init__(self, match, self.root + match.group(1))
self.chapter_id = match.group(2)
self.session.headers["Referer"] = self.root

View File

@ -63,7 +63,7 @@ class KomikcastChapterExtractor(KomikcastBase, ChapterExtractor):
)
def __init__(self, match):
ChapterExtractor.__init__(self, self.root + match.group(1))
ChapterExtractor.__init__(self, match, self.root + match.group(1))
def get_metadata(self, page):
info = text.extract(page, '<b>', "</b>")[0]

View File

@ -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

View File

@ -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):

View File

@ -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, "<title>", "</title>")

View File

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

View File

@ -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, (

View File

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

View File

@ -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(

View File

@ -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()):

View File

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

View File

@ -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)

View File

@ -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, '<title>', "</title>")[0]

View File

@ -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):

View File

@ -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 = ""

View File

@ -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):

View File

@ -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):

View File

@ -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)

View File

@ -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):

View File

@ -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):

View File

@ -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()

View File

@ -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

View File

@ -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):

View File

@ -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)

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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)

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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)

View File

@ -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):

View File

@ -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)

View File

@ -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)

View File

@ -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):

View File

@ -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):

View File

@ -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

View File

@ -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):

View File

@ -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", {}