Skip to main content

Utility to convert youtube-dl/yt-dlp json metadata to .nfo

Project description

ytdl-nfo : youtube-dl NFO generator

youtube-dl is an incredibly useful resource to download and archive footage from across the web. Viewing and organising these files however can be a bit of a hassle.

ytdl-nfo takes the --write-info-json output from youtube-dl and parses it into Kodi-compatible .nfo files. The aim is to prepare and move files so as to be easily imported into media centers such as Plex, Emby, Jellyfin, etc.

Warning This package is still in early stages and breaking changes may be introduced.

NOTE: youtube-dl derivatives

This package was originally built for youtube-dl, however the aim is to be compatible with related forks as well. Currently these are:

Installation

Requirements: Python 3.8

Python 3 pipx (recommended)

pipx is tool that installs a package and its dependencies in an isolated environment.

  1. Ensure Python 3.8 and pipx is installed
  2. Install with pipx install ytdl-nfo

Python 3 pip

  1. Ensure Python 3.8 is installed
  2. Install with pip install ytdl-nfo

Package from source

  1. Ensure Python 3.8 and Python Poetry is installed
  2. Clone the repo using git clone https://github.com/owdevel/ytdl_nfo.git
  3. Create a dev environment with poetry install
  4. Build with poetry build
  5. Install from the dist directory with pip install ./dist/ytdl_nfo-x.x.x.tar.gz

Development Environment

  1. Perform steps 1-3 of package from source
  2. Run using poetry run ytdl-nfo or use poetry shell to enter the virtual env

Usage

Automatic

Run ytdl-nfo JSON_FILE replacing JSON_FILE with either the path to the file you wish to convert, or a folder containing files to convert. The tool will automatically take any files ending with .json and convert them to .nfo using the included extractor templates.

Examples

Convert a single file

ytdl-nfo great_video.info.json

Convert a directory and all sub directories with .info.json files

ytdl-nfo video_folder

Manual

ytdl-nfo uses a set of YAML configs to determine the output format and what data comes across. This is dependent on the extractor flag which is set by youtube-dl. Should this fail to be set or if a custom extractor is wanted there is the --extractor flag. ytdl-nfo will then use extractor with the given name as long as it is in the config directory with the format custom_extractor_name.yaml.

ytdl-nfo --extractor custom_extractor_name great_video.info.json

Config Location

Run the following command to get the configuration location.

ytdl-nfo --config

Extractors

Issues/Pull Requests are welcome to add more youtube-dl supported extractors to the repo.

Custom Extractors

Coming Soon...

Todo

  • Add try catches to pretty print errors
  • Documentation and templates for creating custom extractors
  • Documentation of CLI arguments
  • Recursive folder searching
  • Add package to pypi

Authors Note

This is a small project I started to learn how to use python packaging system whilst providing some useful functionality for my home server setup. Issues/pull requests and constructive criticism is welcome.

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

ytdl_nfo-0.3.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

ytdl_nfo-0.3.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file ytdl_nfo-0.3.0.tar.gz.

File metadata

  • Download URL: ytdl_nfo-0.3.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for ytdl_nfo-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d738bff7480e4bcb60b31c652c20ec61fd44b1502c6615dea8ff21d6a3623670
MD5 95aa6d3835903a0331fcd2b63c5b12a8
BLAKE2b-256 9597d77e4da774eb30572544ac573964a5ce46e9a90ba510111ac34214336976

See more details on using hashes here.

File details

Details for the file ytdl_nfo-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ytdl_nfo-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/5.15.90.1-microsoft-standard-WSL2

File hashes

Hashes for ytdl_nfo-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5a34528df108b8602aefba4015f1b35ac69ea8089697cd0cc9beaa1c4c7ce5ac
MD5 145419ebe943f3272540af995b2d08e9
BLAKE2b-256 c99557503c78708902b24a627159f280dd11b081e9bcaefe5bc87b64e51c77dd

See more details on using hashes here.

Supported by

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