[GH-ISSUE #739] song videoIds in get_album(browseid) return video versions instead of the song counterparts #475

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

Originally created by @zigzatuzoo on GitHub (Feb 4, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/739

Describe the bug
When you download a song using the videoId from the get_album function it gets the music video version because the watch id that is returned is the wrong one.

To Reproduce

  1. Select a playlist
    Lets say SMITHEREENS by Joji
    url = 'https://music.youtube.com/playlist?list=OLAK5uy_k3PjxW48IpcnVsPn-AWVoll_mJvV2b6DY'
  2. Get the album info
url = 'https://music.youtube.com/playlist?list=OLAK5uy_k3PjxW48IpcnVsPn-AWVoll_mJvV2b6DY'

from ytmusicapi import YTMusic
api = YTMusic()
a = api.get_album(api.get_album_browse_id(url.split('playlist?list=')[1]))
  1. Get the song watch ids
for song in a['tracks']:
    print(song['title'] +' - '+ song['videoId'])

The id we should expect for Glimpse of us is OkNx2kt0vV0 ... Instead we get FvOpPeKSf_4

You can see this in action if you go to the song link below and click the toggle for Song/Video and watch the URL
https://music.youtube.com/watch?v=OkNx2kt0vV0

Originally created by @zigzatuzoo on GitHub (Feb 4, 2025). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/739 **Describe the bug** When you download a song using the videoId from the get_album function it gets the music video version because the watch id that is returned is the wrong one. **To Reproduce** 1. Select a playlist Lets say SMITHEREENS by Joji ```url = 'https://music.youtube.com/playlist?list=OLAK5uy_k3PjxW48IpcnVsPn-AWVoll_mJvV2b6DY'``` 2. Get the album info ``` url = 'https://music.youtube.com/playlist?list=OLAK5uy_k3PjxW48IpcnVsPn-AWVoll_mJvV2b6DY' from ytmusicapi import YTMusic api = YTMusic() a = api.get_album(api.get_album_browse_id(url.split('playlist?list=')[1])) ``` 3. Get the song watch ids ``` for song in a['tracks']: print(song['title'] +' - '+ song['videoId']) ``` The id we should expect for Glimpse of us is `OkNx2kt0vV0` ... Instead we get `FvOpPeKSf_4` You can see this in action if you go to the song link below and click the toggle for Song/Video and watch the URL https://music.youtube.com/watch?v=OkNx2kt0vV0
kerem closed this issue 2026-02-27 23:01:00 +03:00
Author
Owner

@sgvictorino commented on GitHub (Feb 4, 2025):

Try api.get_playlist(url.split('playlist?list=')[1]) instead.

<!-- gh-comment-id:2632699683 --> @sgvictorino commented on GitHub (Feb 4, 2025): Try `api.get_playlist(url.split('playlist?list=')[1])` instead.
Author
Owner

@zigzatuzoo commented on GitHub (Feb 4, 2025):

Try api.get_playlist(url.split('playlist?list=')[1]) instead.

Huh ... That does work ... Weird.
If this is the intended behavior feel free to close the issue ... But I don't see any mention about this behavior in the documentation so I assume it's not.

<!-- gh-comment-id:2632736607 --> @zigzatuzoo commented on GitHub (Feb 4, 2025): > Try `api.get_playlist(url.split('playlist?list=')[1])` instead. Huh ... That does work ... Weird. If this is the intended behavior feel free to close the issue ... But I don't see any mention about this behavior in the documentation so I assume it's not.
Author
Owner

@sigma67 commented on GitHub (Feb 4, 2025):

@zigzatuzoo do you get the correct ID if you use an authenticated account? Anonymous/non premium accounts prefer video versions

<!-- gh-comment-id:2634616848 --> @sigma67 commented on GitHub (Feb 4, 2025): @zigzatuzoo do you get the correct ID if you use an authenticated account? Anonymous/non premium accounts prefer video versions
Author
Owner

@zigzatuzoo commented on GitHub (Feb 4, 2025):

I'm just running anon. Haven't tried using an account ... I do have a premium account though so I'll try that later when I get the chance.

<!-- gh-comment-id:2634622136 --> @zigzatuzoo commented on GitHub (Feb 4, 2025): I'm just running anon. Haven't tried using an account ... I do have a premium account though so I'll try that later when I get the chance.
Author
Owner

@sortedcord commented on GitHub (Feb 8, 2025):

@zigzatuzoo I was facing a similar issue where it was only fetching details of the video counterparts of the tracks. As soon as I authenticated with my yt premium account, it automatically switched to the audio versions.

I was specifically looking out for the durations of the items which were significantly longer for the video versions but logging in seems to have rectified this.

<!-- gh-comment-id:2645793617 --> @sortedcord commented on GitHub (Feb 8, 2025): @zigzatuzoo I was facing a similar issue where it was only fetching details of the video counterparts of the tracks. As soon as I authenticated with my yt premium account, it automatically switched to the audio versions. I was specifically looking out for the durations of the items which were significantly longer for the video versions but logging in seems to have rectified this.
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#475
No description provided.