[paheal] implement fast '--range' support (#5905)

pull/5951/head
Mike Fährmann 2 months ago
parent ca3e7a5e5a
commit d2dda2bc00
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -77,6 +77,7 @@ class PahealTagExtractor(PahealExtractor):
pattern = (r"(?:https?://)?(?:rule34|rule63|cosplay)\.paheal\.net"
r"/post/list/([^/?#]+)")
example = "https://rule34.paheal.net/post/list/TAG/1"
page_start = 1
per_page = 70
def __init__(self, match):
@ -87,11 +88,16 @@ class PahealTagExtractor(PahealExtractor):
if self.config("metadata"):
self._extract_data = self._extract_data_ex
def skip(self, num):
pages = num // self.per_page
self.page_start += pages
return pages * self.per_page
def get_metadata(self):
return {"search_tags": self.tags}
def get_posts(self):
pnum = 1
pnum = self.page_start
while True:
url = "{}/post/list/{}/{}".format(self.root, self.tags, pnum)
page = self.request(url).text

Loading…
Cancel
Save