Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect track count for playlists with 1000+ songs #650

Open
RealCalumPlays opened this issue Sep 28, 2024 · 0 comments · May be fixed by #651
Open

Incorrect track count for playlists with 1000+ songs #650

RealCalumPlays opened this issue Sep 28, 2024 · 0 comments · May be fixed by #651

Comments

@RealCalumPlays
Copy link

RealCalumPlays commented Sep 28, 2024

Hello all,

This is an issue with the regex in the playlist mixin. It causes only the first group to be returned. For example if the playlist had 3647 songs it would return 3 due to how re.search(r"\d+", song_count_text) is used.

To Reproduce
Steps to reproduce the behavior:

  1. Find a playlist with 1000+ songs
  2. Use the YTMusic.get_playlist() function
  3. Print the trackCount object.
  4. It should return only the first digit

Additional context

from ytmusicapi import YTMusic

# Initialize YouTube Music API
ytmusic = YTMusic()

PLAYLIST_ID = "XXXXXX"

# Call get_playlist
playlist = ytmusic.get_playlist(PLAYLIST_ID)

#Print trackCount to the console
print(playlist["trackCount"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant