From 9f7aa0d4675d0e6bc7955c83fca3c2a691f8ca9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 6 Oct 2025 08:00:26 +0200 Subject: [PATCH] [weibo] use 'page' parameter for 'feed' results (#7523 #8128 #8357) --- gallery_dl/extractor/weibo.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/weibo.py b/gallery_dl/extractor/weibo.py index 6d433196..c08653f7 100644 --- a/gallery_dl/extractor/weibo.py +++ b/gallery_dl/extractor/weibo.py @@ -203,8 +203,12 @@ class WeiboExtractor(Extractor): raise exception.AbortExtraction( f'"{data.get("msg") or "unknown error"}"') - data = data["data"] - statuses = data["list"] + try: + data = data["data"] + statuses = data["list"] + except KeyError: + return + yield from statuses # videos, newvideo @@ -217,7 +221,8 @@ class WeiboExtractor(Extractor): # album if since_id := data.get("since_id"): params["sinceid"] = since_id - continue + else: + params["sinceid"] = None # home, article if "page" in params: @@ -304,7 +309,7 @@ class WeiboFeedExtractor(WeiboExtractor): def statuses(self): endpoint = "/statuses/mymblog" - params = {"uid": self._user_id(), "feature": "0"} + params = {"uid": self._user_id(), "page": 1, "feature": "0"} return self._pagination(endpoint, params)