mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #389] How to know if there's a corresponding/counterpart video for the song? #306
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#306
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 @alex29ua on GitHub (May 1, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/389
I'm willing to get a list of official videos for my music library. Those that appear in the "Song/Video" tab switch sometimes.
So far no luck. I have even tried debugging the browser page to find when the "Video" switch becomes active, and how it knows the video ID, but it doesn't look openly available in the responses.
I got a list of all my songs in the library (just "Google download / takeout" feature), so I have their IDs.
The thing that might work, but kind of ugly and not fully tested, is to get the album id for each song, and then use the
get_album()call - and only then theMUSIC_VIDEO_TYPE_OMVvalue appears. Otherwise, when I doget_song()call, there's no indication of video being available. Also those "MUSIC_VIDEO_TYPE_" seem to be not what I'd expect.What I have also noticed is that the IDs produced by
get_album()are different from what the YTmusic website uses, and they seem to be the ids of the actual corresponding videos.For example, what I use for testing: there's a song
-vIAjs5nGFoand the album id for it isMPREb_8XwWknRIRMO. And when I doget_album(), I get a different ID for this song,MtHEiuuYt8k(which happens to be the actual video id as well).Any suggestions about this confusion and about the easiest way of finding the videos for songs?
@sigma67 commented on GitHub (May 1, 2023):
Counterpart can be identified via get_watch_playlist: https://ytmusicapi.readthedocs.io/en/stable/reference.html#ytmusicapi.YTMusic.get_watch_playlist
BrowseId vs VideoId (the MPRE.. is a browseId): https://ytmusicapi.readthedocs.io/en/stable/faq.html#what-is-a-browseid
In general, use an authenticated instance if you want to get only songs.
Does this help?