Skip to content
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

Structured Solution for Obtaining YouTube API Credentials (Fixes #132, #150) #154

Closed
wants to merge 11 commits into from

Conversation

AmidelEst
Copy link

Description:
After a thorough analysis of issues #132 and #150, I have developed a structured solution to simplify and automate the process of obtaining YouTube API credentials. This solution addresses the common challenges users face and minimizes manual intervention.

Key Features

  1. raw_headers.txt:

    • A simple document for users to paste their request headers.
  2. generate_ytmusic_credentials.py:

    • A script that processes the raw_headers.txt file and automatically generates an oauth.json file.
  3. Enhanced User Experience:

    • Clear instructions from start to finish for using the project with minimal friction.
    • The solution significantly reduces annoyance and complexity in setting up credentials.

Changes in this PR

  • Added raw_headers.txt to store request headers.
  • Created generate_ytmusic_credentials.py to automate credential generation.
  • Updated documentation README to include step-by-step guidance on this new method.

Benefits

Testing

  • Successfully tested the new workflow on multiple environments to ensure reliability and ease of use.
  • Updated instructions validated by testing with a clean setup.

Thank you for considering this contribution! I'm happy to make adjustments or provide additional details as required.

AmidelEst and others added 8 commits December 29, 2024 14:48
Added a new section under "Getting Started" to guide users through the process of:
- Creating a Google Cloud project.
- Enabling the YouTube Data API v3.
- Setting up OAuth credentials for "TV and Limited Input Devices."
- Adding test users to the OAuth consent screen.

This resolves the missing information needed for successful configuration post-November 2024 updates.
**Details:**
- Created and added a new script, `generate_ytmusic_credentials.py`, to transform raw request headers (copied from Firefox) into a valid credentials file named `oauth.json`.

- Added `oauth.json` to the `.gitignore` file to ensure sensitive data is not tracked in version control.

- Included an empty placeholder file, `raw_headers.txt`, intended to hold the sensitive raw request headers copied from the browser.

- **TODO:** In the next commit, `raw_headers.txt` will also be added to `.gitignore` to prevent tracking of sensitive credentials.

- Updated the README by removing the previous instructions for generating credentials using the GCP API, as those credentials were causing issues.

**Impact:**
This update simplifies the setup process for authenticated requests and ensures that sensitive data is securely handled and excluded from version control.
…w request headers are not tracked in version control.

- Updated the README file with clear and concise instructions for using generate_ytmusic_credentials.py to obtain YouTube Music API credentials.

Impact: These changes enhance security by preventing sensitive files from being tracked and provide users with straightforward steps to generate API credentials efficiently.
- Ensured the app functions correctly when working on a clone of my forked project's main branch.
- Refactored the README file to provide a clearer explanation of the project workflow and order.
@AmidelEst AmidelEst closed this Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants