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.0.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.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yt_metadata_verifier-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 1452bbef196ee6f1ffd93db529ca2aabf2f4086662b15701167ac4d3a38a05ad
MD5 f568790e47554c2e7911fc1de219969f
BLAKE2b-256 1e0a29a195eb10cbbc7ccec7b839a8295e29d523787ccaa3972c3922e36b0af9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for yt_metadata_verifier-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 933a11fce6d4b206c4465861ed4292f8dd6f20f0e393987feb62a6164b5b346e
MD5 d597ea2f71a38e8fd4db8968b74a2ff5
BLAKE2b-256 df5c9d2c953fdd448d14f8e7052ca532239e3b456a33560b4e8674ec6c146f35

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