mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #64] yt.get_song does not work for uploaded songs #48
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#48
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 @xplorr on GitHub (Aug 25, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/64
I try to get the dict info from an uploaded song, but for all uploaded songids I try, I get the same error.
Here is the content of my test python script isolating the problem:
And this is the error it generates no matter what uploaded songid I specify:
What is the reason?
ps. all my other calls creating playlists, adding songs to playlists etc. work perfectly
ps. for public songs, the call works ok
ps. i need this function to remove songs from an existing playlist (YTMusic.remove_playlist_items)
@sigma67 commented on GitHub (Aug 26, 2020):
This method was not intended for uploaded songs, so I'm not surprised it yields an error. I'll have to look into it to see if it's possible to get metadata for a single uploaded song somehow.
As for your actual use case, I'm not sure why you'd need this call to remove uploaded items from a playlist. The proper way to this is to first call
get_playlist, then filter out the items you want to remove, and then callremove_playlist_itemswith a List of Dicts, where each Dict contains avideoIdand asetVideoIdfrom the playlist you're targeting.@xplorr commented on GitHub (Aug 26, 2020):
I need it because for my WinAmp/WACUP sync tool WinaYo, I create a local "database" of songsids and playlistids to be able to sync my local playlists with Youtube Music. So I already have all the songids of all playlists (to do SQL queries). Because I want to reduce the number of ytmusicapi calls, I use this information iso calling get_playlist again.
Besides, all other functions (I tested so far) of ytmusicapi also work correctly with uploaded songids, so consequently I expected that yt.get_song would also work for uploaded songs. So, would be very glad if it worked.
@sigma67 commented on GitHub (Aug 26, 2020):
Makes sense so far, but to be able to remove entries from the playlist again you also need to store the setVideoId for each playlist entry in your database. The song id (videoId) is not enough. I'm not sure how
get_songwould help you achieve that goal?Nevertheless, I'll do some research on retrieving metadata for uploaded songs.
@xplorr commented on GitHub (Aug 26, 2020):
Because I avoid/don't allow double songid entries in playlists.
@sigma67 commented on GitHub (Aug 31, 2020):
The
get_video_infoAPI used byget_songdoes not work with uploaded songs.The metadata you see in the web API is retrieved from the
nextendpoint used byget_watch_playlist, which is quite unstructured and has no annotations for the text (i.e. if it's artist, title etc.). See the below example. So I'm not sure if it's possible to support uploaded songs properly. Perhaps we could add a metadata key to the response ofget_watch_playlist.@xplorr commented on GitHub (Aug 31, 2020):
That would be a real pity if the function get_song() does not work with uploaded songs.
@sigma67 commented on GitHub (Feb 11, 2021):
I believe get_watch_playlist should now return sufficient information (first track of returned tracks).