[GH-ISSUE #63] ytmusic.upload_song() does not return songid #46

Closed
opened 2026-02-27 22:07:44 +03:00 by kerem · 2 comments
Owner

Originally created by @xplorr on GitHub (Aug 22, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/63

When uploading a new song using ytmusic.upload_song(), the function should return a songid when succeeded.
Now it only returns STATUS_SUCCEEDED but no id, so you cannot add the song to a playlist afterwards.
There is also no reliable function to retrieve the songid from the song just uploaded (YTMusic.search() is not specific enough and unreliable).
There is only ytmusic.get_library_upload_songs(50000) to retrieve all uploaded songs, but this can take long if you have a large library (a few minutes for a library of 20000 songs.
Can you either fix this or create a function to get the songid of the last uploaded song.
Other option is to create a filter in the YTMusic.search() to get the last uploaded song.

Originally created by @xplorr on GitHub (Aug 22, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/63 When uploading a new song using ytmusic.upload_song(), the function should return a songid when succeeded. Now it only returns STATUS_SUCCEEDED but no id, so you cannot add the song to a playlist afterwards. There is also no reliable function to retrieve the songid from the song just uploaded (YTMusic.search() is not specific enough and unreliable). There is only ytmusic.get_library_upload_songs(50000) to retrieve all uploaded songs, but this can take long if you have a large library (a few minutes for a library of 20000 songs. Can you either fix this or create a function to get the songid of the last uploaded song. Other option is to create a filter in the YTMusic.search() to get the last uploaded song.
kerem closed this issue 2026-02-27 22:07:44 +03:00
Author
Owner

@sigma67 commented on GitHub (Aug 22, 2020):

It's not possible to return the videoId due to the way the upload flow works. After you upload a song/video, it is processed asynchronously, as you can see in your uploaded songs tab. I assume the videoId is assigned after processing is finished - or at least it's not available to the client before that.

The upload request itself only returns an empty response, as you can see if you inspect it in the browser.

Sorry if this is not helpful, but it's a limitation of YTMusic itself. Unless we get some sorting options on the uploaded songs list there's no way to just get the most recently uploaded song either.

<!-- gh-comment-id:678684815 --> @sigma67 commented on GitHub (Aug 22, 2020): It's not possible to return the videoId due to the way the upload flow works. After you upload a song/video, it is processed asynchronously, as you can see in your uploaded songs tab. I assume the videoId is assigned after processing is finished - or at least it's not available to the client before that. The upload request itself only returns an empty response, as you can see if you inspect it in the browser. Sorry if this is not helpful, but it's a limitation of YTMusic itself. Unless we get some sorting options on the uploaded songs list there's no way to just get the most recently uploaded song either.
Author
Owner

@xplorr commented on GitHub (Aug 22, 2020):

Thanks! I already suspected this. It's a pity.

<!-- gh-comment-id:678685388 --> @xplorr commented on GitHub (Aug 22, 2020): Thanks! I already suspected this. It's a pity.
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#46
No description provided.