[GH-ISSUE #389] How to know if there's a corresponding/counterpart video for the song? #306

Closed
opened 2026-02-27 23:00:04 +03:00 by kerem · 1 comment
Owner

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 the MUSIC_VIDEO_TYPE_OMV value appears. Otherwise, when I do get_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 -vIAjs5nGFo and the album id for it is MPREb_8XwWknRIRMO. And when I do get_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?

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 the `MUSIC_VIDEO_TYPE_OMV` value appears. Otherwise, when I do `get_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 `-vIAjs5nGFo` and the album id for it is `MPREb_8XwWknRIRMO`. And when I do `get_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?
kerem closed this issue 2026-02-27 23:00:05 +03:00
Author
Owner

@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?

<!-- gh-comment-id:1529707502 --> @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?
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#306
No description provided.