[GH-ISSUE #748] get_library_playlist - limit does not respond appropiately #482

Closed
opened 2026-02-27 23:01:02 +03:00 by kerem · 1 comment
Owner

Originally created by @pigmeo1 on GitHub (Mar 2, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/748

Using ytmusicapi version 1.10.1, executing get_library_playlist() always shows a minimum of 25 items, even if the limit is set to a lower number. This seems to me a similar behavior to another issue reported for get_playlist(), where the limit of the songs was not working appropiately.

Using the following code:

def print_all_playlists(l=None):
     """
     Fetches and prints all playlist titles from the user's YouTube Music library.
     """
     try:
         ytmusic = YTMusic("browser.json")
         playlists = ytmusic.get_library_playlists(limit=l)

         if playlists:
             print("All Playlists:")
             for i,p in enumerate(playlists):
                 print(f"{i+1} : {p['title']} - {p['playlistId']}")
         else:
             print("No playlists found.")
     except Exception as e:
         print(f"Error fetching library playlists: {e}")

Examples:
Limit not set:

In [13]: print_all_playlists()
All Playlists:
1 : Liked Music - LM
2 : New Episodes - RDPN
....
24 : WS Dancing - PLPbrAwFXEBqg0C6NLz_DsAbOuA50yvZD7
25 : WS Intro/Outtro - PLPbrAwFXEBqhiYdzdsBNofS8H1B16ZG1l

Limit to 5:

In [14]: print_all_playlists(5)
All Playlists:
1 : Liked Music - LM
2 : New Episodes - RDPN
...
24 : WS Dancing - PLPbrAwFXEBqg0C6NLz_DsAbOuA50yvZD7
25 : WS Intro/Outtro - PLPbrAwFXEBqhiYdzdsBNofS8H1B16ZG1l

Limit to 100:

In [15]: print_all_playlists(100)
All Playlists:
1 : Liked Music - LM
2 : New Episodes - RDPN
...
24 : WS Dancing - PLPbrAwFXEBqg0C6NLz_DsAbOuA50yvZD7
25 : WS Intro/Outtro - PLPbrAwFXEBqhiYdzdsBNofS8H1B16ZG1l
Originally created by @pigmeo1 on GitHub (Mar 2, 2025). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/748 Using ytmusicapi version 1.10.1, executing get_library_playlist() always shows a minimum of 25 items, even if the limit is set to a lower number. This seems to me a similar behavior to another issue reported for get_playlist(), where the limit of the songs was not working appropiately. Using the following code: ``` def print_all_playlists(l=None): """ Fetches and prints all playlist titles from the user's YouTube Music library. """ try: ytmusic = YTMusic("browser.json") playlists = ytmusic.get_library_playlists(limit=l) if playlists: print("All Playlists:") for i,p in enumerate(playlists): print(f"{i+1} : {p['title']} - {p['playlistId']}") else: print("No playlists found.") except Exception as e: print(f"Error fetching library playlists: {e}") ``` Examples: Limit not set: ``` In [13]: print_all_playlists() All Playlists: 1 : Liked Music - LM 2 : New Episodes - RDPN .... 24 : WS Dancing - PLPbrAwFXEBqg0C6NLz_DsAbOuA50yvZD7 25 : WS Intro/Outtro - PLPbrAwFXEBqhiYdzdsBNofS8H1B16ZG1l ``` Limit to 5: ``` In [14]: print_all_playlists(5) All Playlists: 1 : Liked Music - LM 2 : New Episodes - RDPN ... 24 : WS Dancing - PLPbrAwFXEBqg0C6NLz_DsAbOuA50yvZD7 25 : WS Intro/Outtro - PLPbrAwFXEBqhiYdzdsBNofS8H1B16ZG1l ``` Limit to 100: ``` In [15]: print_all_playlists(100) All Playlists: 1 : Liked Music - LM 2 : New Episodes - RDPN ... 24 : WS Dancing - PLPbrAwFXEBqg0C6NLz_DsAbOuA50yvZD7 25 : WS Intro/Outtro - PLPbrAwFXEBqhiYdzdsBNofS8H1B16ZG1l ```
kerem closed this issue 2026-02-27 23:01:02 +03:00
Author
Owner
<!-- gh-comment-id:2692811183 --> @sigma67 commented on GitHub (Mar 2, 2025): https://ytmusicapi.readthedocs.io/en/stable/faq.html#why-is-ytmusicapi-returning-more-results-than-requested-with-the-limit-parameter
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#482
No description provided.