[GH-ISSUE #301] get_library_playlists(), get_library_songs() and other get_library functions failing #233

Closed
opened 2026-02-27 22:08:44 +03:00 by kerem · 5 comments
Owner

Originally created by @jake-g on GitHub (Sep 28, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/301

Hi, I'm running into an issue specific to the get_library functions and struggling to find a workaround

Ive tried many other 'get_*' i.e., get_song() get_history() api calls and they all seem to work. It is the get_library functions that are failing.

Ive updated the py packages, regenerated my creds and the code im using has worked fine in the past...
Im guessing something changed on the youtube music side
(my last issue was https://github.com/sigma67/ytmusicapi/issues/173, my account seems to get early updates)

Example

from ytmusicapi import YTMusic
yt = YTMusic('../headers_auth.json')
yt.get_library_playlists()

results in the following error trace:
(other get_library commands end in a similar TypeError: `'NoneType' object is not subscriptable

File /usr/local/lib/python3.9/site-packages/ytmusicapi/mixins/library.py:31, in LibraryMixin.get_library_playlists(self, limit)
     27 response = self._send_request(endpoint, body)
     29 results = find_object_by_key(nav(response, SINGLE_COLUMN_TAB + SECTION_LIST),
     30                              'itemSectionRenderer')
---> 31 results = nav(results, ITEM_SECTION + GRID)
     32 playlists = parse_content_list(results['items'][1:], parse_playlist)
     34 if 'continuations' in results:

File /usr/local/lib/python3.9/site-packages/ytmusicapi/navigation.py:72, in nav(root, items, none_if_absent)
     70     return None
     71 else:
---> 72     raise err

File /usr/local/lib/python3.9/site-packages/ytmusicapi/navigation.py:66, in nav(root, items, none_if_absent)
     64 try:
     65     for k in items:
---> 66         root = root[k]
     67     return root
     68 except Exception as err:

TypeError: 'NoneType' object is not subscriptable

Let me know if there is anything i can try or provide from my end!

Originally created by @jake-g on GitHub (Sep 28, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/301 Hi, I'm running into an issue specific to the get_library functions and struggling to find a workaround Ive tried many other 'get_*' i.e., get_song() get_history() api calls and they all seem to work. It is the get_library functions that are failing. Ive updated the py packages, regenerated my creds and the code im using has worked fine in the past... Im guessing something changed on the youtube music side (my last issue was https://github.com/sigma67/ytmusicapi/issues/173, my account seems to get early updates) Example ``` from ytmusicapi import YTMusic yt = YTMusic('../headers_auth.json') yt.get_library_playlists() ``` results in the following error trace: (other get_library commands end in a similar TypeError: `'NoneType' object is not subscriptable ``` File /usr/local/lib/python3.9/site-packages/ytmusicapi/mixins/library.py:31, in LibraryMixin.get_library_playlists(self, limit) 27 response = self._send_request(endpoint, body) 29 results = find_object_by_key(nav(response, SINGLE_COLUMN_TAB + SECTION_LIST), 30 'itemSectionRenderer') ---> 31 results = nav(results, ITEM_SECTION + GRID) 32 playlists = parse_content_list(results['items'][1:], parse_playlist) 34 if 'continuations' in results: File /usr/local/lib/python3.9/site-packages/ytmusicapi/navigation.py:72, in nav(root, items, none_if_absent) 70 return None 71 else: ---> 72 raise err File /usr/local/lib/python3.9/site-packages/ytmusicapi/navigation.py:66, in nav(root, items, none_if_absent) 64 try: 65 for k in items: ---> 66 root = root[k] 67 return root 68 except Exception as err: TypeError: 'NoneType' object is not subscriptable ``` Let me know if there is anything i can try or provide from my end!
kerem 2026-02-27 22:08:44 +03:00
  • closed this issue
  • added the
    yt-update
    label
Author
Owner

@sigma67 commented on GitHub (Sep 28, 2022):

Did you get a new library interface on the web? Seems like something changed on the YouTube end again as you said.

If you'd like I can reproduce the issue with your credentials again as we did last time (ytmusicapi@gmail.com) to develop a fix.

<!-- gh-comment-id:1260489801 --> @sigma67 commented on GitHub (Sep 28, 2022): Did you get a new library interface on the web? Seems like something changed on the YouTube end again as you said. If you'd like I can reproduce the issue with your credentials again as we did last time (ytmusicapi@gmail.com) to develop a fix.
Author
Owner

@jake-g commented on GitHub (Sep 29, 2022):

yes the web ui looks different now that i think about it. library and other tabs.

Ill send you the creds

<!-- gh-comment-id:1261659989 --> @jake-g commented on GitHub (Sep 29, 2022): yes the web ui looks different now that i think about it. library and other tabs. Ill send you the creds
Author
Owner

@sigma67 commented on GitHub (Sep 29, 2022):

I fixed it in a backwards compatible way. Can you verify that it works for you?

<!-- gh-comment-id:1262707554 --> @sigma67 commented on GitHub (Sep 29, 2022): I fixed it in a backwards compatible way. Can you verify that it works for you?
Author
Owner

@jake-g commented on GitHub (Oct 3, 2022):

Awesome, just got back from vacation so I'll try later today.

On Thu, Sep 29, 2022, 12:13 PM sigma67 @.***> wrote:

I fixed it in a backwards compatible way. Can you verify that it works for
you?


Reply to this email directly, view it on GitHub
https://github.com/sigma67/ytmusicapi/issues/301#issuecomment-1262707554,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACPD3YQ34LQSNHNHQ7BN25DWAXS7LANCNFSM6AAAAAAQXLWZVA
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- gh-comment-id:1265865579 --> @jake-g commented on GitHub (Oct 3, 2022): Awesome, just got back from vacation so I'll try later today. On Thu, Sep 29, 2022, 12:13 PM sigma67 ***@***.***> wrote: > I fixed it in a backwards compatible way. Can you verify that it works for > you? > > — > Reply to this email directly, view it on GitHub > <https://github.com/sigma67/ytmusicapi/issues/301#issuecomment-1262707554>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/ACPD3YQ34LQSNHNHQ7BN25DWAXS7LANCNFSM6AAAAAAQXLWZVA> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
Author
Owner

@jake-g commented on GitHub (Oct 4, 2022):

yuuup, looks like this is resolved when i use the latest commit, i.e.:

pip3 install git+https://github.com/sigma67/ytmusicapi.git@master

thanks for jumping on this!

<!-- gh-comment-id:1266367620 --> @jake-g commented on GitHub (Oct 4, 2022): yuuup, looks like this is resolved when i use the latest commit, i.e.: `pip3 install git+https://github.com/sigma67/ytmusicapi.git@master` thanks for jumping on this!
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#233
No description provided.