johnwmillr / LyricsGenius

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

Request: Support reading token from file when using command line #197

Closed AndydeCleyre closed 3 years ago

AndydeCleyre commented 3 years ago

Is your feature request related to a problem? Please describe. I would like to provide the token via a file, without exposing the credential as an environment variable (or as part of the command), to better manage security.

Describe the solution you'd like When using the CLI:

Describe alternatives you've considered I can use a shell file and source that, but the credential will still be exposed as an environment variable.

allerter commented 3 years ago

Although this would be a nice utility to have, you don't really need LyricsGenius to do this. You can easily use Python's standard library configparser to parse your config file and extract your token. We'd just do the same if we added this option to LyricsGenius. If you'd like to add this feature, a PR is more than welcome.

AndydeCleyre commented 3 years ago

To be clear, this request is regarding use of the CLI.

allerter commented 3 years ago

In the case of the CLI, we could add alternate paths to check for a token as I've seen other projects do that.

allerter commented 3 years ago

But is the token any safer in a file rather than as an environment variable? It seems that an env var might be the safest and the most convenient option.

allerter commented 3 years ago

I'm closing this issue as it seems to be solved. Feel free to comment here if you have anything else to add.