Add optional parameters for OAuth client ID and secret to setup (#688)

* Add optional parameters for OAuth client ID and secret to setup

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

* Improve setup parameter parsing and help texts

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

* ruff autofix

* wip: remove default oauth_client_id & secret, turn into mandatory params

* fix yt_oauth fixture

* fix format/lint

* fix cli args and oauth test

* remove skip

---------

Co-authored-by: sigma67 <sigma67.github@gmail.com>
This commit is contained in:
fischcode 2024-12-17 13:15:33 +01:00 • committed by GitHub
commit fe95f5974e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 59 additions and 34 deletions

View file

@ -8,6 +8,8 @@ headers_empty = headers_account_with_empty_library_as_json_as_string
browser_file = ./browser.json
oauth_file = ./oauth.json
headers_raw = raw_headers_pasted_from_browser
client_id = yt-data-api-client-id-tv
client_secret = yt-data-api-client-secret-tv
[queries]
uploads_songs = query_gives_gt_20_songs