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

Added OAuth2 class, remaining API endpoints and some docs for contribution #159

Closed allerter closed 3 years ago

allerter commented 3 years ago

This PR completes the support of LyricsGenius of all the API endpoints available. I've also added the OAuth2 class with its docs, examples, and tests. I double if anyone will be using the endpoints that require a user access token, but it's nice to have them available just in case. I also added some text to contributing.rst so that users who want to contribute can check the styling of their code before opening their PR. I think it's also important to note that I renamed all instances of GENIUS_CLIENT_ACCESS_TOKEN TO GENIUS_ACCESS_TOKEN to avoid confusion since client access token is just one of the two kinds of tokens available: client access tokens and user tokens. The tests will also need a user token will all permissions token to be able to test the methods that are already implemented and the new ones that require a user access token with sufficient permission.

allerter commented 3 years ago

@johnwmillr, this PR is ready to be merged.

allerter commented 3 years ago

The OAuth2 can't really be tested since it requires user input. But we could use a mock request just to test that it returns the correct result.

allerter commented 3 years ago

I added the tests for the OAuth2 class and the utils functions. But now the tests require three more env vars: GENIUS_CLIENT_ID, GENIUS_CLIENT_SECRET, GENIUS_REDIRECT_URI.

johnwmillr commented 3 years ago

@Allerter, I'm not sure why the commits from your PRs have been getting squashed, but I just now turned off the "Allow merge commits" option for this repository. Hopefully that resolves the issue.