mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-25 15:26:01 +03:00
[GH-ISSUE #43] KeyError when retrieving library songs list #33
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#33
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 @luckybuzz on GitHub (Jul 14, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/43
first off, huge thanks to sigma67 for taking on this project. i'm an addictive user of google play music, and have been dreading the switch... but thanks to this project i may be able to find a similar satisfaction with YT music in the long run.
this is my first issue, so apologies for any missing/incomplete info. thanks in advance for any assistance you can provide.
i have v0.8.1 installed, and have been poking around learning the usage. when i attempted get_library_songs(), i got the following result:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\isaacq\AppData\Roaming\Python\Python38\site-packages\ytmusicapi\ytmusic.py", line 554, in get_library_songs
results = nav(results, ITEM_SECTION)['musicShelfRenderer']
KeyError: 'musicShelfRenderer'
@sigma67 commented on GitHub (Jul 14, 2020):
Glad you like it! I have also noticed odd behavior with get_library_songs like sporadically failing tests. The oddest part is that it seems to return a different count of songs every API call.
I haven't stumbled upon your error however. Do you have songs in your library?
If yes, would you mind placing a breakpoint at that line and sharing the contents of the
responsevariable?@luckybuzz commented on GitHub (Jul 14, 2020):
thx for your quick reply! i couldn't think of an easy way to share the contents of
response, so I saved to a .csv and saved it for you at [http://isaacq.ca/files/response.csv]. hope this helps!EDIT: oh and to answer your question, there are only 2 songs in my library as of right now.
@luckybuzz commented on GitHub (Jul 14, 2020):
sigma i owe you a big apology. the problem was on my end and i've diagnosed it. turns out the cookie from my Firefox session was for my main Google account, but all my music and playlists were somehow on a brand account, so your script was talking to an empty YTM account. i'm very sorry for creating the extraneous issue and for wasting your time. will stay tuned for future developments!
@sigma67 commented on GitHub (Jul 15, 2020):
No problem, this issue is still valid. You should not get an error if the account is empty, you should get an empty list instead. Can you verify if this issue appears with other library methods as well for your main account?
@luckybuzz commented on GitHub (Jul 15, 2020):
actually, there were playlists in my main account, just no individual
songs. so using playlist methods worked fine for me, i only got the error
previously mentioned when querying about my library songs.
at this point, i switched everything over to my main account, so can no
longer replicate the original error as all my songs are there now.
off topic, do you know if youtube music makes play counts for individual
songs available to the api, like google play music does?
thanks again :)
On Wed, Jul 15, 2020 at 4:15 AM sigmatics notifications@github.com wrote:
@sigma67 commented on GitHub (Jul 15, 2020):
No, they are not available. The best you can do is use
get_history, but it only includes each song once. If you play it again the song just moves up in the list.