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

Genre query early stopping #271

Open
orlevit opened this issue Apr 16, 2024 · 0 comments
Open

Genre query early stopping #271

orlevit opened this issue Apr 16, 2024 · 0 comments

Comments

@orlevit
Copy link

orlevit commented Apr 16, 2024

I am using the snippets in the docs: link to get "Getting songs by tag (genre)":

# this gets the lyrics of all the songs that have the pop tag.
genius = Genius(token)
page = 1
lyrics = []
while page:
    res = genius.tag('pop', page=page)
    for hit in res['hits']:
        song_lyrics = genius.lyrics(song_url=hit['url'])
        lyrics.append(song_lyrics)
    page = res['next_page']

I am running this code with tag : "bachata" and noticed that one page is returning 19 results instead of 20:
image

In the source code : "res['next_page']" is None if the length of the hits not equals 20...
Is it a bug?

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

No branches or pull requests

1 participant