[danbooru] move extractor logic from booru.py
This commit is contained in:
@@ -27,7 +27,6 @@ class BooruExtractor(SharedConfigMixin, Extractor):
|
||||
page_start = 1
|
||||
page_limit = None
|
||||
sort = False
|
||||
ugoira = True
|
||||
|
||||
def __init__(self, match):
|
||||
super().__init__(match)
|
||||
@@ -52,11 +51,7 @@ class BooruExtractor(SharedConfigMixin, Extractor):
|
||||
|
||||
for image in images:
|
||||
try:
|
||||
if "pixiv_ugoira_frame_data" in image and \
|
||||
"large_file_url" in image and not self.ugoira:
|
||||
url = image["large_file_url"]
|
||||
else:
|
||||
url = image["file_url"]
|
||||
url = image["file_url"]
|
||||
except KeyError:
|
||||
continue
|
||||
if url.startswith("/"):
|
||||
@@ -112,12 +107,6 @@ class XmlParserMixin():
|
||||
return [post.attrib for post in root]
|
||||
|
||||
|
||||
class DanbooruPageMixin():
|
||||
"""Pagination for Danbooru v2"""
|
||||
def update_page(self, data):
|
||||
self.params["page"] = "b{}".format(data["id"])
|
||||
|
||||
|
||||
class MoebooruPageMixin():
|
||||
"""Pagination for Moebooru and Danbooru v1"""
|
||||
def update_page(self, data):
|
||||
|
||||
Reference in New Issue
Block a user