Skip to content

[tiktok] do not exit account extraction early when we need to manually roll back the cursor#8968

Merged
mikf merged 2 commits intomikf:masterfrom
CasualYT31:tiktok-fix-edge-case-in-account-extraction
Feb 2, 2026
Merged

[tiktok] do not exit account extraction early when we need to manually roll back the cursor#8968
mikf merged 2 commits intomikf:masterfrom
CasualYT31:tiktok-fix-edge-case-in-account-extraction

Conversation

@CasualYT31
Copy link
Contributor

In very rare edge cases, it is possible for TikTok to return no items from a creator/item_list request, whilst indicating that there are more items with the hasMorePrevious: true flag.

The yt-dlp code our extractor took inspiration from addressed this by manually rolling back the cursor. This is something we also carry out (see TiktokLegacyTimeCursor.next_page()), but there was a fault in the logic within TiktokItemListRequest.extract_items() that caused account extraction to exit early if it encountered no items, even if hasMorePrevious was true.

This PR addresses the fault by only exiting account extraction early if we encounter no items and TikTok indicates that no more posts are available. An item counter was added alongside the page logs to give users a better understanding of the extraction's progress.

It is worth noting that manually rolling back the cursor is something the TikTok website does not do, which causes affected accounts to have an empty or partial list of posts on their page, despite the user having posts uploaded to their account.

@mikf mikf merged commit 7c8fbb6 into mikf:master Feb 2, 2026
9 checks passed
mikf pushed a commit that referenced this pull request Feb 8, 2026
* [tiktok] do not exit account extraction early when we need to manually roll back the cursor
* [tiktok] fix rehydration data error string formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants