mirror of
https://github.com/sigma67/ytmusicapi.git
synced 2026-04-26 07:46:00 +03:00
[GH-ISSUE #113] keyError while getting liked songs #79
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#79
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 @zak1388 on GitHub (Dec 2, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/113
I got this error after calling
get_liked_songs().Traceback (most recent call last): File "ytmusic.py", line 5, in <module> liked_songs = ytmusic.get_playlist(playlistId='LM') File "/home/zak/.local/lib/python3.8/site-packages/ytmusicapi/mixins/playlists.py", line 100, in get_playlist playlist['tracks'].extend(parse_playlist_items(results['contents'])) KeyError: 'contents'Tested on Ubuntu 20.04, using python 3.8.5
@sigma67 commented on GitHub (Dec 2, 2020):
Have you liked any songs on this account? Do you see your liked songs when you go to https://music.youtube.com/playlist?list=LM?
@zak1388 commented on GitHub (Dec 3, 2020):
Yes, there's about 980 songs there
@sigma67 commented on GitHub (Dec 3, 2020):
The other library calls work for you? i.e.
get_library_playlists@zak1388 commented on GitHub (Dec 4, 2020):
Nah it just returns a bunch of playlists called "test", and i cant access the playlist ids on the website either.
@sigma67 commented on GitHub (Dec 4, 2020):
That is very vague, please provide more specifics. This is impossible to debug at this point.
@zak1388 commented on GitHub (Dec 4, 2020):
[{'title': 'test', 'playlistId': 'PLYpXmfKMEkF612pd0h_ICGCL_Ku9cAPE7', 'thumbnails': [{'url': 'https://lh3.googleusercontent.com/FoVQFdW6zBi3sNA_yZJSV3VTWmi0belhhFzleuEbn27utkirstj1woXHfWmWqkNyHla37ZFbk_F6jvVV=w226-h226-l90-rj', 'width': 226, 'height': 226}, {'url': 'https://lh3.googleusercontent.com/FoVQFdW6zBi3sNA_yZJSV3VTWmi0belhhFzleuEbn27utkirstj1woXHfWmWqkNyHla37ZFbk_F6jvVV=w544-h544-l90-rj', 'width': 544, 'height': 544}], 'count': '1'}, {'title': 'test', 'playlistId': 'PLYpXmfKMEkF4HdftoyUjGh1S9BZBptvPt', 'thumbnails': [{'url': 'https://i.ytimg.com/vi/bx1Bh8ZvH84/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nTWReOwPrwHjPF5BprvzcbEpmMRw', 'width': 400, 'height': 225}, {'url': 'https://i.ytimg.com/vi/bx1Bh8ZvH84/hq720.jpg?sqp=-oaymwEXCKAGEMIDIAQqCwjVARCqCBh4INgESFo&rs=AMzJL3ldgnXFtqgQDnCMo_NfhGcXcqqbdw', 'width': 800, 'height': 450}], 'count': '1'}, {'title': 'test', 'playlistId': 'PLYpXmfKMEkF5CIUITqbqRu_gLs0nZAx1G', 'thumbnails': [{'url': 'https://i.ytimg.com/vi/bx1Bh8ZvH84/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nTWReOwPrwHjPF5BprvzcbEpmMRw', 'width': 400, 'height': 225}, {'url': 'https://i.ytimg.com/vi/bx1Bh8ZvH84/hq720.jpg?sqp=-oaymwEXCKAGEMIDIAQqCwjVARCqCBh4INgESFo&rs=AMzJL3ldgnXFtqgQDnCMo_NfhGcXcqqbdw', 'width': 800, 'height': 450}], 'count': '1'}, {'title': 'test', 'playlistId': 'PLYpXmfKMEkF6uAkXZP_5X9fnUyfQTv5RR', 'thumbnails': [{'url': 'https://i.ytimg.com/vi/bx1Bh8ZvH84/sddefault.jpg?sqp=-oaymwEWCJADEOEBIAQqCghqEJQEGHgg6AJIWg&rs=AMzJL3nTWReOwPrwHjPF5BprvzcbEpmMRw', 'width': 400, 'height': 225}, {'url': 'https://i.ytimg.com/vi/bx1Bh8ZvH84/hq720.jpg?sqp=-oaymwEXCKAGEMIDIAQqCwjVARCqCBh4INgESFo&rs=AMzJL3ldgnXFtqgQDnCMo_NfhGcXcqqbdw', 'width': 800, 'height': 450}], 'count': '1'}]Basically it returns playlists, but these aren't any of them in my library, and i cant access them using their playlistIds
@sigma67 commented on GitHub (Dec 4, 2020):
If these aren't the right playlists you're probably using wrong credentials. Are you sure you used a request from your actual account for setup?
If you are, please provide the code you're using to setup the YTMusic instance.
@zak1388 commented on GitHub (Dec 4, 2020):
Alright, ill try setting the auth headers again
@zak1388 commented on GitHub (Dec 4, 2020):
Okay so i set the headers using
YTMusic.setup('headers_auth.json')just like the instructions. That worked fine so i set the instance to a variableytm = YTMusic('headers_auth.json')then calledprint(ytm.get_library_playlists())just to check the output. And I still got the same output from the earlier comment.@sigma67 commented on GitHub (Dec 4, 2020):
Again, are you sure you're using the right account? Do you have brand accounts?
@zak1388 commented on GitHub (Dec 4, 2020):
Whoops, yep i think thats it, sorry about that. All good now, thanks man