-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for songs without lyrics #24
Conversation
Hey there, The PR looks fantastic! I’ve never come across that issue before, but thank you so much for addressing it. I’m currently on vacation, so I might not be able to properly merge it until next Monday or so, but I’ll do my best to get to it sooner. Here are a few things I wanted to point out:
Other than that, everything looks great! |
Or we could do one thing: instead of removing instrumentals, we could turn it into a feature by generating a different type of poster specifically for them. |
Hi! Thanks for the feedback! |
Hey! Great to see you here! Thanks for making those changes, they look good. Just a quick heads-up, no need to mess with the alternative lyrics search through Genius for now. That’s something we’ll save for v2. It’ll be a bigger update, so no rush on that. Also, I’m not gonna filter the songs. But yeah, we do need a way to figure out if a song is instrumental or not. LRClib has this For Spotify, the Search endpoint doesn’t directly say if a track is instrumental, but the Audio Features endpoint has an instrumentalness attribute, which tells us how likely it is. It’s the best option. So instead of checking whether the lyrics are available or not we should first check whether it's instrumental or not and then we proceed according to that. Oh, and about the posters, some people suggested shrinking them for instrumental tracks since there’s no lyrics, but honestly, I’m not a fan of that. It’d look weird and just be a waste of resources. I’d rather fill that gap with something interesting. What do you think we should add? |
Anyways, sorry lol!!! I don't have my setup with me so I'm typing all of this with a phone. But it seems like you've already started working on genius, so I guess we should consider this as a minor update. |
If you want, you can come up with some prototype by using photoshop or photopea that you can show :)) |
I think it's best if we put some stats in the space, that would probably fix the problem. And also happy new year to you :)) |
after looking at the spotify documentation i found a few stats that we could include:
|
Hey! So, we should probably avoid using too many third-party services. The more we rely on them, the messier it gets to deal with conflicts. Like, one might have a feature for a track or album, but another might not, so it’s best to keep things simple. Here’s what I’m thinking: We’ll use LRClib to check if a track is instrumental. If it is, we’ll pull some extra details from Spotify, like mood, genre, tempo, and stream count. For mood, we could use words like “Happy” if it crosses a certain threshold (e.g., x > 0.6). This way, we avoid empty spaces on the posters and keep them looking neat. For tracks with no lyrics, I’m planning to add a sub-project under BeatPrints where users can upload lyrics to LRClib’s database. It’s a win-win. The more people use it, the more lyrics get added, and the fewer gaps we’ll have over time. Also, I’m thinking of using Oh, and about lyricsgenius, I think it’d be better to revert those changes for now. It’s just making things more complicated than they need to be. Let me know what you think! |
sounds good! i'll start working on it |
so turns out the only spotify api endpoint with genres is the artist endpoint (why don't they classify songs 😔) |
do you think we should keep the option for people to just have a blank poster without the instrumental text? |
Edit: never mind, there was a bug in my testing script (whoops) |
Honestly, same! That’s exactly why I made BeatPrints.. Etsy prices are no joke. The idea was to keep it budget-friendly, but hey, if you’re getting them professionally printed, your wall’s about to look 🎀 |
I’d strongly recommend against it- I think a blank poster wouldn’t look all that great. Since spotify.py, lyrics.py, and poster.py work together to make these, any issues can be fixed by tweaking how they connect to keep things running smoothly. If lyrics are not found, we can always prompt user to input it. |
I agree, however i think having multiple instrumental posters next to each other all with the same text would look a bit weird. |
I forgot to mention, but the second text will be chosen randomly from a list. This way, it feels more natural and less repetitive. For now let's just focus getting this feature done. I might even fork your repo to make some nice changes :)) |
anything else to do? |
Great, I'll look into the code and let you know! It might take some time, but hopefully I'll merge it as soon as possible. |
There are some bugs in your code, that I need to fix, as it may conflict with the API itself. |
- added placeholders for instrumental tracks - added method to check if a track is instrumental - fixed prompt.py"
I fixed some code, mind checking them? :) |
cli/prompt.py
Outdated
|
||
except errors.NoLyricsAvailable: | ||
print("\n😦 • Couldn't find lyrics from sources.") | ||
pasteLyrics = questionary.confirm( | ||
"📋 • Would you like to paste the lyrics instead?", default=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a lot of instrumental songs are not in the lrcAPI database, so I think we should still give users the option to mark a track as instrumental?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking a track as instrumental when it actually has lyrics but the API doesn’t provide them doesn’t sit right with me. It feels misleading. A better approach might be to label it as “Lyrics Unavailable” or allow users to manually input the lyrics if they want. This keeps things accurate and avoids confusion.
apart from that, everything looks great 👍 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright time to merge it in!
docs/guidebook/generate.rst
Outdated
@@ -30,7 +30,7 @@ To generate a track poster, follow the steps below. | |||
# Get the track's metadata and lyrics | |||
metadata = search[0] | |||
lyrics = ly.get_lyrics(metadata) | |||
highlighted_lyrics = ly.select_lines(lyrics, "5-9") | |||
highlighted_lyrics = ly.select_lines(lyrics, "6-9") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be "5-9"
cli/prompt.py
Outdated
|
||
except errors.NoLyricsAvailable: | ||
print("\n😦 • Couldn't find lyrics from sources.") | ||
pasteLyrics = questionary.confirm( | ||
"📋 • Would you like to paste the lyrics instead?", default=False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marking a track as instrumental when it actually has lyrics but the API doesn’t provide them doesn’t sit right with me. It feels misleading. A better approach might be to label it as “Lyrics Unavailable” or allow users to manually input the lyrics if they want. This keeps things accurate and avoids confusion.
One of my favourite songs, Swallow by Casiopea, does not have any lyrics (fusion jazz).
When I tried to use the CLI to make a poster, it presented me with this:
which would always show 'invalid range' no matter what I put in.
This pull request adds a check for if the returned lyrics are
None
, and raises NoLyricsAvailable.It also allows users to make posters without lyrics:
spotify.Spotify.track()
now has a default of no lyrics. In the cli, the user will get an option not to paste lyrics if no lyrics are found.Finally, it fixes a small line selection error in the docs (5-9 is five lines)