The Trailer Database — an open-source database of every trailer for every movie, in every language.
TrailerDB is a comprehensive database mapping 336,627 movies to their trailers on YouTube. It collects:
- Every trailer type: theatrical, teaser, TV spots, red band, IMAX, behind the scenes, featurettes, clips, bloopers
- Every language: trailers in 30+ languages via a tiered collection strategy
- YouTube metadata: view counts, channel names, duration, availability status
The database is built by ingesting data from TMDB (The Movie Database) and enriching it with YouTube metadata.
# 1. Clone and install
git clone https://github.com/yourusername/trailerdb.git
cd trailerdb
pip install -r requirements.txt
# 2. Configure API keys
cp .env.example .env
# Edit .env with your TMDB and YouTube API keys
# 3. Bootstrap the database (no API calls needed)
python -m pipeline.run phase0
# 4. Resolve TMDB IDs (~3 hours for all 337K movies)
python -m pipeline.run phase1
# 5. Collect English trailers (~3 hours)
python -m pipeline.run phase2a
# 6. Check progress at any time
python -m pipeline.run status
python -m pipeline.run stats| Phase | Description | Duration | API |
|---|---|---|---|
| 0 | Parse movie list, initialize database | ~2 min | None |
| 1 | Resolve IMDb IDs to TMDB IDs | ~3 hours | TMDB Find |
| 2a | Collect English trailers | ~3 hours | TMDB Videos |
| 2b | Collect multilingual trailers (30 languages) | ~20 hours | TMDB Videos |
| 3 | Enrich with YouTube metadata | ~1-2 days | YouTube Data v3 |
| 4 | YouTube search for movies missing trailers | Ongoing | YouTube Search |
All phases are fully resumable — you can stop and restart at any point.
- TMDB: Free at themoviedb.org
- YouTube Data API v3: Free at Google Cloud Console (10,000 units/day)
The output is a SQLite database (db/trailerdb.db) with these main tables:
movies— 336,627 movies with IMDb/TMDB IDs, ratings, metadatatrailers— YouTube trailer links with type, language, region, metadatagenres/movie_genres— Genre classificationingestion_log— Pipeline progress tracking
Trailers are collected in tiers to optimize API usage:
- Tier 1 (all movies): English, Spanish, French, German, Japanese
- Tier 2 (top 50K movies): Portuguese, Korean, Chinese, Italian, Russian, Hindi, Arabic, Dutch, Polish, Turkish
- Tier 3 (top 10K movies): 15 additional languages
MIT