Skip to main content

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 --help support
  • ✅ 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

MIT © taj


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yt_metadata_verifier-1.0.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yt_metadata_verifier-1.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file yt_metadata_verifier-1.0.1.tar.gz.

File metadata

  • Download URL: yt_metadata_verifier-1.0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.4 Windows/11

File hashes

Hashes for yt_metadata_verifier-1.0.1.tar.gz
Algorithm Hash digest
SHA256 939940ac7e148205f220cc72871f7414dcc263ad1c3452c7894772558192f590
MD5 219f652a7c782bac11a53b47c9d5085a
BLAKE2b-256 717f3060f10650cfe6579e35cc1aa0c3cdc6bbdad41b3d70c7b08a94e7eebe53

See more details on using hashes here.

File details

Details for the file yt_metadata_verifier-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for yt_metadata_verifier-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7254185298cbfaa1ca432f03d293ad6fc6f6ba4f019bae44727b090d1f9f350e
MD5 5b9070f4611b8a4ac8eb98b70ace733f
BLAKE2b-256 d74643b5fbd22749ec4b4a63b0b79860f20955acef013a2d3a3860f7ca5ecedd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page