CLI tool to fetch and verify YouTube video metadata
Project description
🎥 YouTube Metadata Verifier CLI
A lightweight Python CLI tool to verify and correct YouTube video metadata, such as title and channel information. Useful for digital archiving, content validation, or simply cleaning up saved URLs.
✨ Features
- ✅ Fetch accurate video titles and channel names from YouTube
- ✅ Compare or correct existing metadata
- ✅ Outputs valid and error entries to separate JSON files
- ✅ Clean CLI with
--version,--verbose, and--helpsupport - ✅ Packaged with Poetry
📦 Installation
1. Clone the repo
git clone https://github.com/taj54/youtube-metadata-verifier.git
cd youtube-metadata-verifier
2. Install dependencies
poetry install
3. Use the CLI
poetry run yt-verify --help
⚙️ Usage
Basic Command
poetry run yt-verify --json data/videos.json
Full Example
poetry run yt-verify --json data/videos.json --output data/corrected.json --errors data/errors.json --verbose
Available Options
| Option | Description |
|---|---|
--json |
Path to input JSON file with video URLs |
--output |
File to save corrected metadata (default: corrected.json) |
--errors |
File to save errors (default: errors.json) |
--verbose |
Enable detailed logging |
--version |
Show current CLI version |
📄 Input Format
Your input file should be a JSON array with at least a url field for each video:
[
{
"url": "ttps://www.youtube.com/watch?v=WH0lsTxcw4w"
}
]
📝 Output Example
[
{
"title": "Midnight Coding Session 💻 Coding Lofi Music To Make You Deep Focus On You Work 💻 Programming Lofi",
"url": "https://www.youtube.com/watch?v=WH0lsTxcw4w",
"duration": "11:11:55",
"tags": [
"Dream lofi",
"Dream lofi channel",
"Study",
"Sleep",
"study music",
"lofi hip hop",
"chill lofi",
"lofi music",
"lofi study",
"lofi sleep",
"sleep music",
"Deep Sleeping Music",
"chill music",
"lofi studying",
"studying lofi",
"lofi",
"dreamy lofi",
"lofi girl",
"stop overthinking",
"sleep lofi",
"lofi sleep music",
"lofi live",
"sleeping music for deep sleeping",
"lo fi",
"Midnight Coding Session",
"Coding Lofi Music",
"Deep Focus On You Work",
"Programming Lofi",
"lofi corgi",
"corgi lofi",
"lofi programming",
"programming lofi"
],
"channel": {
"name": "Dreamy Lofi",
"url": "https://www.youtube.com/@Mellow_lofi"
}
}
]
🐛 Error Handling
Any failed lookups are saved to the --errors file:
[
{
"url": "https://www.youtube.com/watch?v=invalid",
"error": "Video unavailable"
}
]
🧪 Dev Tips
Run locally
python src/yt_metadata_verifier/cli.py --json data/videos.json
Export as CLI tool
poetry build
pip install dist/yt_metadata_verifier-<version>.whl
yt-verify --version
📄 License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yt_metadata_verifier-1.0.2.tar.gz.
File metadata
- Download URL: yt_metadata_verifier-1.0.2.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8310a4132f266d68c921b862b0c10dc5e6612cc9cb8112dc0ce2d3de52ccf3e
|
|
| MD5 |
992dd1532b1918d8c099547e1b8f161b
|
|
| BLAKE2b-256 |
fcda032e06a8d74a61904f25d6720fb6b041a1baaa32b68596d087e41c1253b9
|
File details
Details for the file yt_metadata_verifier-1.0.2-py3-none-any.whl.
File metadata
- Download URL: yt_metadata_verifier-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bc808600e33c295d8aa285dc9b24c2165be95e0be8b5cf9b93be5e121af8a54
|
|
| MD5 |
6338acf77cdcc5a7010871b8c17a722f
|
|
| BLAKE2b-256 |
b4a604b3763ba505a4c240b724c5d7cf17d128251c9fa07a9447e9692a8e80a6
|