Depending on the features you want to use, different credentials are required.
- YouTube Data API Key
- Service Account JSON
- Spreadsheet ID
- OAuth Client Secrets JSON
- Open https://console.cloud.google.com
- Sign in with your Google account
- Click Select project
- Click New project
- Name it for example
youtube-exporter - Click Create
- In the project go to APIs and Services
- Click Library
- Search for YouTube Data API v3
- Click Enable
- Go to APIs and Services → Credentials
- Click Create credentials
- Select API key
- Copy the generated key
Optional but recommended:
- Restrict the key to YouTube Data API v3 only
This key is entered into the field:
YouTube Data API Key
This step is required only if you want to write data to Google Sheets.
- Go to APIs and Services → Library
- Search for Google Sheets API
- Click Enable
This step is required only for Google Sheets export.
- Go to APIs and Services → Credentials
- Click Create credentials → Service account
- Name it for example
sheets-writer - Finish creation
- Open the Service Account
- Go to Keys
- Click Add key → Create new key
- Choose JSON
- Download the file
This file is selected in the application as:
Service account JSON
- Open your Google Sheet
- Click Share
- Add the service account email
The email can be found inside the JSON file under
client_email - Set permission to Editor
- Save
Without this step the application cannot write to the sheet.
Open your Google Sheet in the browser.
The URL looks like this:
https://docs.google.com/spreadsheets/d/SPREADSHEET_ID/edit
Copy only the part between /d/ and /edit.
Enter this value into:
Spreadsheet ID
The worksheet name must match exactly.
Examples:
- Sheet1
- Example
- Tabellenblatt1
This value is entered into:
Worksheet name
The name is case sensitive.
This step is required only if you want transcripts.
- Go to APIs and Services → Credentials
- Click Create credentials → OAuth client ID
- Choose Desktop application
- Name it for example
transcript-provider - Create and download the JSON file
This file is selected in the application as:
OAuth client secrets JSON
- Go to OAuth consent screen
- Choose External
- Set an application name
- Set a support email
- Set a developer contact email
- Save
- Scroll to Test users
- Add your Google email address
- Save
Without adding a test user Google will block the login.
The project is structured as a Python package and must be started from the project root folder.
The root folder contains:
youtube_exporter/directoryrequirements.txt
On Windows, you can simply double click start.bat in the project root folder.
This will automatically install all required dependencies and launch the graphical interface.
- Open the project root folder
- Open a terminal in that folder
- Install dependencies
pip install -r requirements.txt
- Start the graphical interface
python -m youtube_exporter.main
- Open Visual Studio Code
- Click File → Open Folder and select the project root folder
- Open the terminal via Terminal → New Terminal
- Install dependencies
pip install -r requirements.txt
- Start the application
python -m youtube_exporter.main
The tool can also be executed without the graphical interface.
Example:
python -m youtube_exporter.main --api-key YOUR_API_KEY --channel @channelname --max 10
- The Google Sheet is not shared with the service account
- The service account does not have Editor permissions
- The worksheet name does not exist
- The worksheet name is misspelled or uses different capitalization
- The YouTube Data API daily quota has been reached
- Wait until the quota resets or use a new Google Cloud project
- The channel does not provide captions
- You do not have ownership or access via OAuth
- This is expected and compliant behavior
This project uses only:
- YouTube Data API v3
- Google Sheets API
- YouTube Captions API via OAuth
Transcripts are never scraped. If transcripts are not officially accessible, the field remains empty.
- Fully compliant with Google and YouTube policies
- Reusable and configurable
- Safe for client delivery
- No scraping and no policy violations
End of documentation.