[GH-ISSUE #45] get_artist doesn't return music videos for some artists #34

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

Originally created by @grray on GitHub (Jul 15, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/45

Code to reproduce

import os, json
from ytmusicapi import YTMusic

conf_file = os.path.dirname(__file__)+'/headers_auth.json'
ytmusic = YTMusic(conf_file)

result = ytmusic.get_artist('UCBQZwaNPFfJ1gZ1fLZpAEGw')     
print(json.dumps(result, indent=2)) 

doesn't have "videos" section, although youtube music page and android app have it.

Originally created by @grray on GitHub (Jul 15, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/45 Code to reproduce ```python import os, json from ytmusicapi import YTMusic conf_file = os.path.dirname(__file__)+'/headers_auth.json' ytmusic = YTMusic(conf_file) result = ytmusic.get_artist('UCBQZwaNPFfJ1gZ1fLZpAEGw') print(json.dumps(result, indent=2)) ``` doesn't have "videos" section, although youtube music page and android app have it.
kerem closed this issue 2026-02-27 22:07:40 +03:00
Author
Owner

@sigma67 commented on GitHub (Jul 15, 2020):

Not quite sure, for me it doesn't have a videos section. I see Albums, Singles, Featured On and Fans Might Also Like. Can you post a screenshot of your page?

<!-- gh-comment-id:658657674 --> @sigma67 commented on GitHub (Jul 15, 2020): Not quite sure, for me it doesn't have a videos section. I see Albums, Singles, Featured On and Fans Might Also Like. Can you post a screenshot of your page?
Author
Owner

@grray commented on GitHub (Jul 15, 2020):

Yes, sure. https://imgur.com/a/1kj7TTk My country is Ukraine.

<!-- gh-comment-id:658669417 --> @grray commented on GitHub (Jul 15, 2020): Yes, sure. https://imgur.com/a/1kj7TTk My country is Ukraine.
Author
Owner

@grray commented on GitHub (Jul 15, 2020):

It shows the same sections even if I'm not logged in. Its weird, perhaps it's some stupid region restriction, but why then python script on my PC see it differently?

<!-- gh-comment-id:658672263 --> @grray commented on GitHub (Jul 15, 2020): It shows the same sections even if I'm not logged in. Its weird, perhaps it's some stupid region restriction, but why then python script on my PC see it differently?
Author
Owner

@sigma67 commented on GitHub (Jul 15, 2020):

It might be related to the GL variable configured in context.json. Can you please check your request in browser and report what is used for the GL variable? It should be there in the network tab of your browser under request details.

grafik

<!-- gh-comment-id:658723174 --> @sigma67 commented on GitHub (Jul 15, 2020): It might be related to the GL variable configured in context.json. Can you please check your request in browser and report what is used for the GL variable? It should be there in the network tab of your browser under request details. ![grafik](https://user-images.githubusercontent.com/16363825/87541839-3ede9e80-c6a2-11ea-83fa-bcce25a4a2ad.png)
Author
Owner

@grray commented on GitHub (Jul 15, 2020):

I have gl: UA I tried to change gl in context.json, but it doesn't affect the output, it stays the same. But copying json from browser into context.json solved issue! I found a line, which did the trick, it's "browseId": "UCnX0L9QiftAcWdzeBx31xCw" at json top level.

<!-- gh-comment-id:658753164 --> @grray commented on GitHub (Jul 15, 2020): I have `gl: UA` I tried to change gl in context.json, but it doesn't affect the output, it stays the same. But copying json from browser into context.json solved issue! I found a line, which did the trick, it's `"browseId": "UCnX0L9QiftAcWdzeBx31xCw"` at json top level.
Author
Owner

@sigma67 commented on GitHub (Jul 15, 2020):

I don't think it's the browseId, that is being set by ytmusicapi as well. Can you post your full context.json here?

<!-- gh-comment-id:658756130 --> @sigma67 commented on GitHub (Jul 15, 2020): I don't think it's the browseId, that is being set by ytmusicapi as well. Can you post your full `context.json` here?
Author
Owner

@grray commented on GitHub (Jul 15, 2020):

Oops, i just figured out, that UCnX0L9QiftAcWdzeBx31xCw and UCBQZwaNPFfJ1gZ1fLZpAEGw are two different pages for the same artist and first have videos, while second don't. Don't know whats happening :)

<!-- gh-comment-id:658757460 --> @grray commented on GitHub (Jul 15, 2020): Oops, i just figured out, that UCnX0L9QiftAcWdzeBx31xCw and UCBQZwaNPFfJ1gZ1fLZpAEGw are two different pages for the same artist and first have videos, while second don't. Don't know whats happening :)
Author
Owner

@sigma67 commented on GitHub (Jul 15, 2020):

Yes, seems to be a server-side duplicate. Can we consider this issue resolved?

<!-- gh-comment-id:658759742 --> @sigma67 commented on GitHub (Jul 15, 2020): Yes, seems to be a server-side duplicate. Can we consider this issue resolved?
Author
Owner

@grray commented on GitHub (Jul 15, 2020):

Yes, thank you. For your information, first one is Twenty One Pilots - Topic channel on youtube, second is their official channel, and seems like it should be the same for other artists, which have official youtube channels. They have both the same browseId's for albums, so no luck for me here about getting music videos)

<!-- gh-comment-id:658772555 --> @grray commented on GitHub (Jul 15, 2020): Yes, thank you. For your information, first one is [Twenty One Pilots - Topic](https://www.youtube.com/channel/UCnX0L9QiftAcWdzeBx31xCw) channel on youtube, [second](https://www.youtube.com/channel/UCBQZwaNPFfJ1gZ1fLZpAEGw) is their official channel, and seems like it should be the same for other artists, which have official youtube channels. They have both the same browseId's for albums, so no luck for me here about getting music videos)
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#34
No description provided.