From fa64c38d5b8a28fbba734f147519565628f049eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 14 Sep 2018 17:51:46 +0200 Subject: [PATCH] [sankaku] fix pagination for user favorites (#106) --- gallery_dl/extractor/myportfolio.py | 2 +- gallery_dl/extractor/sankaku.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/myportfolio.py b/gallery_dl/extractor/myportfolio.py index e0322c81..94d88144 100644 --- a/gallery_dl/extractor/myportfolio.py +++ b/gallery_dl/extractor/myportfolio.py @@ -89,7 +89,7 @@ class MyportfolioUserExtractor(Extractor): pattern = [BASE_PATTERN + r"/?$"] test = [ ("https://hannahcosgrove.myportfolio.com/", { - "url": "2d394ed7726bdd60da07454a2ba2a08c641b6c80", + "url": "846814f50114e586adfe1fe809fe0da004f22b46", }), ("myportfolio:https://tooco.com.ar/", { "count": ">= 40", diff --git a/gallery_dl/extractor/sankaku.py b/gallery_dl/extractor/sankaku.py index 88df989a..e32869af 100644 --- a/gallery_dl/extractor/sankaku.py +++ b/gallery_dl/extractor/sankaku.py @@ -225,8 +225,12 @@ class SankakuTagExtractor(SankakuExtractor): return yield from ids + next_url = text.extract(page, 'next-page-url="/?', '"', pos)[0] + if next_url: + params["next"] = text.parse_query(next_url)["next"] + else: + params["next"] = text.parse_int(ids[-1]) - 1 params["page"] = 2 - params["next"] = text.parse_int(ids[-1]) - 1 class SankakuPoolExtractor(SankakuExtractor):