-
Notifications
You must be signed in to change notification settings - Fork 216
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 optional parameters for OAuth client ID and secret to setup #688
Conversation
Use your own Google API client ID and client secret in setup by calling ytmusicapi oauth --client_id <your Google API client ID> --client_secret <your Google API client secret> to avoid HTTP 400: Bad Request errors
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.
Thank you for for figuring this out and submitting the PR. However, there are still some more improvements needed:
- The argparse args you added apply to both setup types, although they don't matter for the
browser
option. This will lead to a misleading CLI (i.e. try running ytmusicapi browser --help). They should only apply to the oauth option. Since the interface is interactive anyway you could also circumvent this by interactively asking for TV auth (deprecated) or client id/secret (recommended) - then request all the info viainput()
. Both solutions are valid imo. - Deprecate the current TV oauth docs and include info on how it should be done currently. This would mean adding guidance on how to correctly create the ID/Secret via Google Cloud. Could be done in a separate PR
nevermind, it does seem to work with that configuration |
- Add subparsers for parameters for oauth and browser tokens - Add help options - Add a check for presence of both client_id and client_secret if oauth is chosen.
Hi |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #688 +/- ##
==========================================
- Coverage 95.04% 94.88% -0.17%
==========================================
Files 38 38
Lines 2282 2288 +6
==========================================
+ Hits 2169 2171 +2
- Misses 113 117 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Use your own Google API client ID and client secret in setup by calling
ytmusicapi oauth --client_id <your Google API client ID> --client_secret <your Google API client secret>
to avoid HTTP 400: Bad Request errors (issue #679 )See developers.google.com/youtube/registering_an_application for instructions on how to create your own youtube OAuth credentials.