This guide explains how to configure the Google Cloud project for YouTubeWhitelist.
- A Google account
- Access to Google Cloud Console
- Go to Google Cloud Console
- Click Select a project → New Project
- Enter project name:
YouTubeWhitelist(or your preferred name) - Click Create
- Go to APIs & Services → Library
- Search for YouTube Data API v3
- Click Enable
- Go to APIs & Services → Credentials
- Click Create Credentials → API Key
- Copy the generated key
- (Recommended) Click Edit API Key → Restrict key:
- Under API restrictions, select Restrict key → YouTube Data API v3
- Under Application restrictions, select Android apps and add your package name + SHA-1 fingerprint
- Click Save
-
Go to APIs & Services → OAuth consent screen
-
Select External → Create
-
Fill in required fields:
- App name:
YouTubeWhitelist - User support email: your email
- Developer contact: your email
- App name:
-
Add scopes:
openid,email,profile -
Save and continue through all steps
-
Go to Credentials → Create Credentials → OAuth client ID
-
Select Web application (required for Authorization Code flow)
-
Add authorized redirect URI:
http://localhost/callback -
Click Create
-
Copy the Client ID
Note: We use a "Web application" type client ID because the app uses a WebView-based OAuth Authorization Code flow (for F-Droid compatibility). Android-type client IDs do not provide a client_id suitable for this flow.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass androidkeytool -list -v -keystore /path/to/your/release.keystore -alias your_aliasAdd the following to your project's local.properties file (never commit this file):
YOUTUBE_API_KEY=your_youtube_api_key_here
GOOGLE_CLIENT_ID=your_oauth_client_id_here- YouTube Data API v3 has a default quota of 10,000 units/day
- Common operations and their costs:
search.list: 100 unitschannels.list: 1 unitvideos.list: 1 unitplaylists.list: 1 unitplaylistItems.list: 1 unit
- Monitor usage at APIs & Services → Dashboard
- Verify the key is correctly copied to
local.properties - Check API key restrictions match your app's package name and SHA-1
- Verify the OAuth client ID is for Web application type
- Verify the redirect URI is exactly
http://localhost/callback - Check that the OAuth consent screen is configured with required scopes
- Normal during development with External consent screen
- Click Continue to proceed (only your test users will see this)
- For production: submit app for Google verification