johnwmillr / LyricsGenius

Download song lyrics and metadata from Genius.com 🎶🎤
http://www.johnwmillr.com/scraping-genius-lyrics/
MIT License
878 stars 159 forks source link

Feature request: add a path option to the genius.save_lyrics()-function #251

Open Tr33Bug opened 1 year ago

Tr33Bug commented 1 year ago

From my view, there is no option to give the save_lyrics()-function a path or destination, where to save. I think that should be added. If I missed something or someone has a smart workaround, please let me know :)

allerter commented 1 year ago

You're right. save_lyrics() has a filename parameter which actually should be a path or destination parameter to determine the path and the filename altogether. A PR doing this would be welcome. One thing that's missing either way is that save_lyrics should return the JSON/TXT string if no filename/path is supplied (the method docs point this out, but it's not implemented).

sufyan-siddiqui commented 1 year ago

I think there should be a separate parameter for for the path as path or destination instead of using the filename parameter, since we are sanitizing special characters from the filename parameter before writing. Although there should be an implementation for returning as string when filename is not mentioned, we are already setting the filename (based on artist/album and song) whenever the base.save_lyrics() is used. So, the method always gets the filename in all of the current use cases.