mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 07:16:00 +03:00
[GH-ISSUE #387] Params key not in get_artist #303
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#303
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 @kalebbroo on GitHub (Apr 29, 2023).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/387
Describe the bug
I am trying to return a list of all the albums from an artist using get_artist_albums. I cannot figure out how to get the perams key. I am only just learning how to code so this is most likely just a dumb mistake on my part. The api docs says to get params use get_artist but I am not able to return that key.
Error searching for artist albums: 'params'
Traceback (most recent call last):
File "C:\Users\kaleb\Desktop\projects\search_youtube\embed.py", line 46, in search_albums
artist_albums_params = artist_data['albums']['params']
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
KeyError: 'params'
To Reproduce
I plan to make this a discord bot, I search for an artist I have been using "will smith" and "loona" for testing. The code will return an key error.
Here is my code:
async def search_albums(ctx, artist_name: str):
artist_name = artist_name.title()
print(f"Searching for albums by artist: {artist_name}")
Additional context
If this is something I am doing wrong in my code just let me know. I have been trying to figure this out all day :(
@sigma67 commented on GitHub (May 1, 2023):
Hi, this doesn't work for all artists. Notably when there is no "More" button on the artist's page next to the albums, there won't be any params.
For example, for Will Smith, singles would work but albums would not: