AUTHENTICATION_SETUP.md 1.8 KB

Authentication Setup

The YouTube Predownloader now uses simplified OAuth authentication for accessing your personal YouTube subscriptions.

Setup Instructions

1. Get Google API Credentials

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the YouTube Data API v3
  4. Go to Credentials → Create Credentials → OAuth 2.0 Client ID
  5. Choose Desktop Application
  6. Download the credentials as client_secret.json
  7. Place the file in your project directory

2. Authenticate

Run the interactive authentication:

python3 auth.py --interactive

This will:

  • Open a browser window
  • Ask you to sign in to Google
  • Request permission to access your YouTube data
  • Save the authentication token for future use

3. Verify Authentication

Test that authentication is working:

python3 -c "from auth import get_token_non_interactive; print('✅ Auth working' if get_token_non_interactive() else '❌ Auth failed')"

Files

  • client_secret.json - Your OAuth credentials (keep private)
  • youtube_token.pickle - Saved authentication token (auto-generated)

Troubleshooting

Token Expired

If you see authentication errors, re-run:

python3 auth.py --interactive

Missing Permissions

Make sure you granted permission to access your YouTube data during authentication.

No Subscriptions Found

If you get 0 subscriptions, ensure:

  1. You're signed in to the correct Google account
  2. That account has YouTube subscriptions
  3. Authentication completed successfully

Security Notes

  • Keep client_secret.json private (add to .gitignore)
  • The youtube_token.pickle file contains your access token
  • Tokens expire and will be automatically refreshed when needed