[GH-ISSUE #406] [1.1.1] Error on ytmusic.get_library_upload_songs #312

Closed
opened 2026-02-27 23:00:07 +03:00 by kerem · 4 comments
Owner

Originally created by @markmandel on GitHub (Jul 5, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/406

Describe the bug

Getting the following error when attempting to run ytmusic.get_library_upload_songs(...)

Traceback (most recent call last):
  File "/home/mark/workspace/ytmusic/./music.py", line 22, in <module>
    uploads = ytmusic.get_library_upload_songs(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mark/workspace/ytmusic/ytmusicapi/mixins/uploads.py", line 49, in get_library_upload_songs
    songs = parse_uploaded_items(results['contents'][1:])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mark/workspace/ytmusic/ytmusicapi/parsers/uploads.py", line 11, in parse_uploaded_items
    entityId = nav(data, MENU_ITEMS)[-1]['menuNavigationItemRenderer']['navigationEndpoint'][
               ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'menuNavigationItemRenderer'

To Reproduce
Steps to reproduce the behavior:

from ytmusicapi import YTMusic

ytmusic = YTMusic("oauth.json")
uploads = ytmusic.get_library_upload_songs(
        order="recently_added",
        limit=500,
)

Additional context
Just to make sure, I updated my version to 1.1.1, but unfortunately that didn't fix the issue. Wondering if YouTube changed their API surface on uploads.

Originally created by @markmandel on GitHub (Jul 5, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/406 **Describe the bug** Getting the following error when attempting to run `ytmusic.get_library_upload_songs(...)` ``` Traceback (most recent call last): File "/home/mark/workspace/ytmusic/./music.py", line 22, in <module> uploads = ytmusic.get_library_upload_songs( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mark/workspace/ytmusic/ytmusicapi/mixins/uploads.py", line 49, in get_library_upload_songs songs = parse_uploaded_items(results['contents'][1:]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/mark/workspace/ytmusic/ytmusicapi/parsers/uploads.py", line 11, in parse_uploaded_items entityId = nav(data, MENU_ITEMS)[-1]['menuNavigationItemRenderer']['navigationEndpoint'][ ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ KeyError: 'menuNavigationItemRenderer' ``` **To Reproduce** Steps to reproduce the behavior: ```python3 from ytmusicapi import YTMusic ytmusic = YTMusic("oauth.json") uploads = ytmusic.get_library_upload_songs( order="recently_added", limit=500, ) ``` **Additional context** Just to make sure, I updated my version to 1.1.1, but unfortunately that didn't fix the issue. Wondering if YouTube changed their API surface on uploads.
kerem 2026-02-27 23:00:07 +03:00
  • closed this issue
  • added the
    yt-update
    label
Author
Owner

@sigma67 commented on GitHub (Jul 10, 2023):

Hi, this seems to be a Google A/B test currently, so your quick fix won't do it. For me it's failing with this change, while it works on current master.

<!-- gh-comment-id:1629671801 --> @sigma67 commented on GitHub (Jul 10, 2023): Hi, this seems to be a Google A/B test currently, so your quick fix won't do it. For me it's failing with this change, while it works on current master.
Author
Owner

@markmandel commented on GitHub (Jul 10, 2023):

Aaaah, I had a wonder.

So will need to redo it as a search rather than a specified number. Sounds like that would be a better option long term anyway.

<!-- gh-comment-id:1629689801 --> @markmandel commented on GitHub (Jul 10, 2023): Aaaah, I had a wonder. So will need to redo it as a search rather than a specified number. Sounds like that would be a better option long term anyway.
Author
Owner

@sigma67 commented on GitHub (Aug 20, 2023):

Are you still seeing this issue?

<!-- gh-comment-id:1685310450 --> @sigma67 commented on GitHub (Aug 20, 2023): Are you still seeing this issue?
Author
Owner

@markmandel commented on GitHub (Aug 21, 2023):

I've been running my locally edited version, and it's been fine - but as you said, looks like I'm in an A/B, in which case if you want to close this PR, please feel free.

If I run into it again, I'll redo it to make it a search based implementation, so it's future proof (or at least as close as it can be).

<!-- gh-comment-id:1686774055 --> @markmandel commented on GitHub (Aug 21, 2023): I've been running my locally edited version, and it's been fine - but as you said, looks like I'm in an A/B, in which case if you want to close this PR, please feel free. If I run into it again, I'll redo it to make it a search based implementation, so it's future proof (or at least as close as it can be).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#312
No description provided.