Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube Metadata Harvester

A high-performance Python utility that reads Video IDs from a CSV file, scrapes rich metadata (including hidden music data like Record Labels) using yt-dlp, and exports the results directly to a Google Sheet.

✨ Features

  • Rich Metadata Extraction: Fetches Artist, Track Title, Duration, Record Label, and Category.
  • Concurrency: Uses multi-threading to process multiple videos simultaneously.
  • Robust UI: Features a beautiful CLI interface with progress bars, spinners, and summary tables using the rich library.
  • Cloud Sync: Automatically handles Google Sheets connections and batch uploads.

🛠 Prerequisites

  • Python 3.7+
  • A Google Cloud Project with Sheets API & Drive API enabled.
  • A Service Account JSON key file (credentials.json).

📦 Installation

  1. Clone or download this repository.

  2. Install dependencies:

pip install pandas gspread yt-dlp rich
  1. Setup Credentials:
  • Place your Google Service Account key in the project folder and rename it to credentials.json.
  • Share your target Google Sheet with the client_email found inside credentials.json.

🚀 Usage

  1. Prepare your CSV:
  • Ensure your input file is named Dom Snow-videos.csv (or update the INPUT_CSV_FILE variable in the script).
  • The first column must contain the YouTube Video IDs.
  1. Run the script:
python video_processor.py

⚙️ Configuration

You can adjust the following variables at the top of video_processor.py:

  • INPUT_CSV_FILE: The source file containing Video IDs.
  • GOOGLE_SHEET_NAME: The name of your Google Spreadsheet.
  • TARGET_TAB_NAME: The specific tab name (e.g., 'yt_101225').
  • MAX_WORKERS: Number of concurrent download threads (Default: 5).

📊 Output Columns

The script generates the following columns in your Google Sheet:

Column Description
Video ID The unique YouTube ID.
URL Direct link to the video.
Artist The detected artist (from music metadata or channel name).
Title/Track The detected track name or video title.
Duration Length of the video (HH:MM:SS).
Record Label Extracted from video description/tags if available.
Category YouTube category (e.g., Music, Gaming).
Upload Date The date the video was published.

⚠️ Notes

  • This script uses yt-dlp to scrape data. While powerful, it is slower than the official API but provides more detailed music data.
  • To avoid rate limits, MAX_WORKERS is set to 5. Increasing this significantly may cause YouTube to temporarily block your IP.

About

Python YouTube metadata harvester

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages