From 4fab8e0dd89dcbdd2295a010c00cc17b724be979 Mon Sep 17 00:00:00 2001 From: CasualYouTuber31 <21147925+CasualYT31@users.noreply.github.com> Date: Mon, 26 Jan 2026 15:50:50 +0000 Subject: [PATCH] [tiktok] do not fail story extraction if user has no stories (#8938) --- gallery_dl/extractor/tiktok.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/tiktok.py b/gallery_dl/extractor/tiktok.py index 363937b8..06cf5c1f 100644 --- a/gallery_dl/extractor/tiktok.py +++ b/gallery_dl/extractor/tiktok.py @@ -912,10 +912,8 @@ class TiktokItemCursor(TiktokPaginationCursor): # We should offset the cursor by the number of items in the response. # Sometimes less items are returned than what was requested in the # count parameter! We could fall back onto the count query parameter - # but we could miss out on some posts, and truth is if the expected - # item list isn't in the response, the extraction was going to fail - # anyway. - self.cursor += len(data[self.list_key]) + # but we could miss out on some posts. + self.cursor += len(data.get(self.list_key, ())) if "hasMore" in data: return not data["hasMore"] return not data.get("HasMoreAfter", False)