fix: watch-later returns empty items despite count > 0 - #22
Open
zwczwczwc wants to merge 1 commit into
Open
Conversation
`get_toview()` was calling `homepage.get_favorite_list_and_toview()` (API x/v3/fav/folder/list4navigate), which only populates the `list` field with favorite folders — the `list` for "稍后再看" (watch-later) is always null from this navigation sidebar endpoint. Switch to the dedicated `user.get_toview_list()` (API x/v2/history/toview), which returns actual watch-later video entries with aid/owner/duration. Also add aid→bvid conversion in `normalize_watch_later_item()` since the toview API returns aid instead of bvid, and include `aid` in the normalised output for completeness. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bili watch-laterreturning count > 0 but empty items listhomepage.get_favorite_list_and_toview()which calls the navigation sidebar API (x/v3/fav/folder/list4navigate) — this API only returns counts for the sidebar badge, not video listsuser.get_toview_list()which callsx/v2/history/toviewand returns the full video listaid→bvidconversion innormalize_watch_later_itemsince the toview API returnsaidnotbvidChanges
bili_cli/client.py: Replaceget_toviewimplementation to useuser.get_toview_list()instead ofhomepage.get_favorite_list_and_toview()bili_cli/payloads.py: Updatenormalize_watch_later_itemto convertaidtobvidfor consistent outputtests/test_client.py: Update tests to mock the new API callhomepageimportTest plan
bili watch-later --yamlnow returns 253 items with proper bvid/author/durationbili favorites,bili history,bili video --subtitle,bili searchall still work🤖 Generated with Claude Code