mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #578] KeyError: 'fixedColumns' in specific circumstance when retrieving uploads #403
Labels
No labels
a/b
bug
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
yt-error
yt-update
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ytmusicapi#403
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @apastel on GitHub (May 5, 2024).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/578
It seems like Google made a minor change with regard to uploading songs that is affecting
get_library_upload_songs()Now when you upload a new song via the web page, after the song finishes processing, it may first appear in your library without a duration:
Then after about 10 seconds or so, when you refresh it will have the duration:
During the brief period of time when there is not yet a duration,
get_library_upload_songs()throws a KeyError for thefixedColumnsattribute, since that entire attribute will be missing:I feel like this is a new change from Google because I'm suddenly experiencing it in unit tests and one user of my app reported it today. It probably reduces the upload processing time on their part by letting the duration get filled in lazily afterwards. I was able to reproduce it outside my app in just a basic test file, and I ran this repeatedly after uploading a song.
So it probably amounts to an attribute check and maybe we just don't include the duration in the results (or
None) if that happens?without_fixedColumns.json
@apastel commented on GitHub (May 7, 2024):
Google is definitely messing with this currently. Now instead of not including the
fixedColumnsobject in the response, it's now included but thedurationis set to' 'which breaks the parser:And although I said that this only happens right after uploading a new song, I had it happen on a user that had about 10k uploaded songs that had been sitting there for years, so I guess it's possible for any uploaded song to have a blank duration.
If I have time I will contribute a PR that will probably look something like this to cover both cases if there are no fixedColums and if the duration is just whitespace or empty string: