LyricsGenius icon indicating copy to clipboard operation
LyricsGenius copied to clipboard

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

Open Tr33Bug opened this issue 2 years ago β€’ 2 comments

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 :)

Tr33Bug avatar Dec 02 '22 23:12 Tr33Bug

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).

allerter avatar Dec 06 '22 21:12 allerter

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.

sufyan-siddiqui avatar Jan 15 '23 10:01 sufyan-siddiqui