text stringclasses 5
values |
|---|
huggingface_hub>=0.20.0 |
python-dotenv>=1.0.0 |
yt-dlp>=2024.1.0 |
requests>=2.28.0 |
isodate>=0.6.1 |
π¬ Creative Commons YouTube Video Metadata Dataset (14,600 Videos)
A comprehensive, balanced benchmark dataset of 14,600 Creative Commons YouTube video links and metadata spanning 20 diverse categories, including everyday ambient scenes and extensive Nepal-related cultural, trekking, and heritage content.
β οΈ Important Legal & License Notice:
Links and metadata only, no video files included. Each video keeps its original Creative Commons license; credit the creators.
π Dataset Overview
- Total Records:
14,600unique video links and metadata records - Categories: 20 balanced categories with exactly 730 videos per category (5.00% each)
- License: Creative Commons Attribution (CC-BY / CC-BY-SA)
- Formats Provided:
metadata.jsonl(JSON Lines) andmetadata.csv(Comma-Separated Values) - Duration Filter: Strictly filtered between 5 seconds and 20 minutes (1,200 seconds) β zero ultra-short clips (<5s) and zero livestreams/full movies (>20min)
- Deduplication: 100% deduplicated by unique
video_id - Geographic & Cultural Diversity: Global coverage with dedicated focus on Nepal (trekking, Himalayan mountain trails, festivals like Dashain/Tihar, Newari heritage, rural villages, local markets).
ποΈ Categories & Distribution
| Category | Description & Scope | Video Count | % of Dataset |
|---|---|---|---|
animals |
Safari wildlife, pets, birds of prey, marine life, domestic animals | 730 | 5.00% |
art |
Oil painting, watercolors, sculpture, printmaking, calligraphy, murals | 730 | 5.00% |
city_life |
Walking tours, urban architecture, street atmosphere, transit, skylines | 730 | 5.00% |
cooking |
Recipes, sourdough baking, curry making, campfire meals, culinary skills | 730 | 5.00% |
dance |
Ballet, hip-hop, contemporary, traditional folk, tango, salsa, bboy | 730 | 5.00% |
diy_crafts |
Woodworking, pottery, leathercraft, knitting, origami, blacksmithing | 730 | 5.00% |
education |
Mathematics, history, physics, philosophy, linguistics, biology, astronomy | 730 | 5.00% |
everyday_scenes |
Rain against windows, coffee rituals, quiet libraries, peaceful gardens | 730 | 5.00% |
fashion |
Sustainable fashion, handloom weaving, vintage styling, bespoke tailoring | 730 | 5.00% |
festivals_culture |
Lantern festivals, street carnivals, folk pageants, solstice bonfires | 730 | 5.00% |
food |
Street food night markets, artisan bread, coffee culture, cheese making | 730 | 5.00% |
gaming |
Indie game showcases, retro speedruns, flight simulators, chess, sandboxes | 730 | 5.00% |
music |
Fingerstyle guitar, piano solos, ambient modular synths, lofi beats | 730 | 5.00% |
nature |
Mountain landscapes, ocean waves, waterfalls, forest wilderness, 4K vistas | 730 | 5.00% |
nepal_content |
Nepali culture, Annapurna/Everest trekking, Kathmandu, villages, festivals | 730 | 5.00% |
science |
Chemical reactions, deep space astrophotography, fluid dynamics, botany | 730 | 5.00% |
sports |
Skateboarding, rock climbing, ocean surfing, basketball, cycling, workouts | 730 | 5.00% |
technology |
Linux OS, electronics soldering, 3D printing, robotics, custom keyboards | 730 | 5.00% |
travel |
Solo backpacking, historic towns, road trips, islands, scenic railways | 730 | 5.00% |
vehicles |
Classic car restoration, motorcycles, ebikes, train cab rides, aviation | 730 | 5.00% |
| TOTAL | 20 Balanced Categories | 14,600 | 100.00% |
π·οΈ Field Explanations
Both metadata.jsonl and metadata.csv contain the following 13 metadata fields:
| Field Name | Type | Example | Description |
|---|---|---|---|
video_id |
string |
QT97HgUUW8w |
Unique 11-character YouTube video identifier |
url |
string |
https://www.youtube.com/watch?v=QT97HgUUW8w |
Canonical YouTube watch URL |
title |
string |
Unreal Sunrise at Khumai Danda | Nepal Trek |
Full video title |
description |
string |
Join our trek to Khumai and Korchan hilltop... |
First 500 characters of the video description |
channel_name |
string |
Anmol Aashish |
Channel or creator display name |
channel_id |
string |
UCx7... |
Unique YouTube channel identifier |
category |
string |
nepal_content |
One of the 20 target categories |
duration_seconds |
integer |
908 |
Video duration in seconds (5s to 1200s) |
language |
string |
ne |
Detected language (en, ne, ja, etc.) |
upload_date |
string |
2024-03-15 |
ISO 8601 upload date (YYYY-MM-DD) |
view_count |
integer |
45200 |
Recorded view count |
license |
string |
Creative Commons (CC-BY) |
Creative Commons license declaration |
tags |
list / string |
["sunrise", "khumai", "nepal", "trek"] |
Topical keywords associated with the video |
π» Quickstart: Loading the Dataset
Method 1: Using Hugging Face datasets
from datasets import load_dataset
# Load directly from Hugging Face
dataset = load_dataset("sushan98/youtube-creative-commons-15k", split="train")
print(f"Loaded {len(dataset):,} video metadata entries!")
sample = dataset[0]
print(f"Title: {sample['title']}")
print(f"Category: {sample['category']}")
print(f"URL: {sample['url']}")
print(f"Duration: {sample['duration_seconds']}s")
Method 2: Using Pandas
import pandas as pd
# Read CSV directly
df = pd.read_csv("https://huggingface.co/datasets/sushan98/youtube-creative-commons-15k/raw/main/metadata.csv")
print(df.groupby("category")["video_id"].count())
β¬οΈ How to Download Videos with yt-dlp
You can use yt-dlp to download videos or extract audio locally.
1. Download a Single Video (MP4, Max 720p/1080p):
yt-dlp -f "bestvideo[height<=720][ext=mp4]+bestaudio[ext=m4a]/best[height<=720][ext=mp4]/best" \
-o "downloads/%(title)s.%(ext)s" \
"https://www.youtube.com/watch?v=QT97HgUUW8w"
2. Batch Download Script in Python:
import json
import subprocess
import os
os.makedirs("downloads", exist_ok=True)
# Read metadata.jsonl
with open("metadata.jsonl", "r", encoding="utf-8") as f:
for i, line in enumerate(f):
item = json.loads(line)
url = item["url"]
cat = item["category"]
title = item["title"]
print(f"[{i+1}/14600] Downloading [{cat}]: {title} ({url})")
# Run yt-dlp to download video
subprocess.run([
"yt-dlp",
"-f", "bestvideo[height<=720]+bestaudio/best[height<=720]",
"-o", f"downloads/{cat}/%(id)s.%(ext)s",
"--max-filesize", "150M",
"--no-playlist",
url
])
if i >= 5: # Sample run
break
π οΈ Reproducing or Resuming the Collection
The companion script collector.py provides a complete, self-healing, resumable collector:
- API Mode: Uses YouTube Data API v3 (
YOUTUBE_API_KEY) with automatic daily quota tracking (10,000 units/day: 100 units/search, 1 unit/videos.list). - Direct Engine: High-performance multi-threaded search using Creative Commons protobuf filter (
params='EgIwAQ=='). - Resumable Storage: SQLite database (
dataset.db) checkpoints progress automatically.
Run the collector:
python collector.py --target 730 --repo-id sushan98/youtube-creative-commons-15k
π‘οΈ License & Attribution
Links and metadata only, no video files included. Each video keeps its original Creative Commons license; credit the creators.
Metadata compilation released under CC-BY 4.0.
- Downloads last month
- 163