[GH-ISSUE #393] get_artist() not always getting albums & singles #305

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

Originally created by @Noiyy on GitHub (May 13, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/393

Describe the bug
Sometimes, for some reason, when I try to get_artist(), it will return a dictionary without "albums"
and "singles" and then I end up getting KeyError: "albums" or "singles" when I try to access them.

To Reproduce
Steps to reproduce the behavior:

  1. get artistID with .search(query, "artists", limit=1)[0]["browseId"]
  2. get artist with .get_artist(artistID)
  3. try to access artist["albums"] or artist["singles"]

Additional context
Also, I don't think limit in search() works, since it returns more than 1 artist

get_artist() dictionary
Without KeyError
Screenshot 2023-05-13 103936
With KeyError
Screenshot 2023-05-13 105700

Originally created by @Noiyy on GitHub (May 13, 2023). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/393 **Describe the bug** Sometimes, for some reason, when I try to `get_artist()`, it will return a dictionary without "albums" and "singles" and then I end up getting `KeyError: "albums"` or `"singles"` when I try to access them. **To Reproduce** Steps to reproduce the behavior: 1. get `artistID` with `.search(query, "artists", limit=1)[0]["browseId"]` 2. get `artist` with `.get_artist(artistID)` 3. try to access `artist["albums"]` or `artist["singles"]` **Additional context** *Also, I don't think `limit` in `search()` works, since it returns more than 1 artist* `get_artist()` dictionary *Without KeyError* ![Screenshot 2023-05-13 103936](https://github.com/sigma67/ytmusicapi/assets/83555059/a4ee90a0-6985-44e2-9b2f-4ed3abc3414a) *With KeyError* ![Screenshot 2023-05-13 105700](https://github.com/sigma67/ytmusicapi/assets/83555059/34656ee1-7434-408b-a932-fc5e79a9c99a)
kerem closed this issue 2026-02-27 23:00:05 +03:00
Author
Owner

@sigma67 commented on GitHub (May 13, 2023):

Likely related to #392

Please check if you have "Top Releases" when going to an artist's page, if yes this issue is a duplicate. Check here: https://music.youtube.com/channel/UClmXPfaYhXOYsNn_QUyheWQ

Regarding limit: https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter

<!-- gh-comment-id:1546656349 --> @sigma67 commented on GitHub (May 13, 2023): Likely related to #392 Please check if you have "Top Releases" when going to an artist's page, if yes this issue is a duplicate. Check here: https://music.youtube.com/channel/UClmXPfaYhXOYsNn_QUyheWQ Regarding limit: https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter
Author
Owner

@Noiyy commented on GitHub (May 13, 2023):

Nope, I don't have "Top Releases" there.
image

<!-- gh-comment-id:1546658884 --> @Noiyy commented on GitHub (May 13, 2023): Nope, I don't have "Top Releases" there. ![image](https://github.com/sigma67/ytmusicapi/assets/83555059/44b1c163-9744-4730-b47d-5a0c36a45b40)
Author
Owner

@sigma67 commented on GitHub (May 13, 2023):

Are you sure you are using the same account as your instance of YTMusic? Are you passing credentials to YTMusic that belong to the same account?

I mean, it seems odd that you're only getting this sometimes.

<!-- gh-comment-id:1546659528 --> @sigma67 commented on GitHub (May 13, 2023): Are you sure you are using the same account as your instance of `YTMusic`? Are you passing credentials to `YTMusic` that belong to the same account? I mean, it seems odd that you're only getting this sometimes.
Author
Owner

@Noiyy commented on GitHub (May 13, 2023):

I'm using it unauthenticated, since I don't have any need to do that. It is very odd indeed, why it happens only sometimes.

<!-- gh-comment-id:1546659977 --> @Noiyy commented on GitHub (May 13, 2023): I'm using it unauthenticated, since I don't have any need to do that. It is very odd indeed, why it happens only sometimes.
Author
Owner

@sigma67 commented on GitHub (May 13, 2023):

Ah alright. I suppose A/B testing would do that when you're not signed in. Please follow #392 for updates.

<!-- gh-comment-id:1546661403 --> @sigma67 commented on GitHub (May 13, 2023): Ah alright. I suppose A/B testing would do that when you're not signed in. Please follow #392 for updates.
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#305
No description provided.