youtube-dl is an incredibly useful tool for downloading and archiving footage from across the web; however, viewing and organizing these files can be a hassle.
ytdl-nfo automates metadata processing so that media files can be easily imported into media centers such as Plex, Emby, Jellyfin, etc. It does this by parsing each .info.json
file created by youtube-dl (using the --write-info-json
flag) and generating a Kodi-compatible .nfo
file.
While this package was originally built for youtube-dl, the goal is to maintain compatibility with related forks, such as yt-dlp.
⚠️ Warning: This package is still in early stages and breaking changes may be introduced.
pipx is a tool that installs a package and its dependencies in an isolated environment.
- Install Python 3.8 (or later)
- Install pipx
- Run
pipx install ytdl-nfo
- Install Python 3.8 (or later)
- Installed pip
- Run
pip install ytdl-nfo
- Install Python 3.8 (or later)
- Install Python Poetry
- Clone the repo using
git clone https://github.com/owdevel/ytdl_nfo.git
- Create a dev environment with
poetry install
- Build with
poetry build
- Install from the
dist
directory withpip install ./dist/ytdl_nfo-x.x.x.tar.gz
youtube-dl uses site-specific extractors to collect technical data about a media file. This metadata, along with the extractor ID, are written to a .info.json
file when the --write-info-json
flag is used. ytdl-nfo uses a set of YAML configs, located in ytdl_nfo/configs
to control how metadata from the JSON file is mapped to NFO tags.
If extractor auto-detection fails or you want to override the default, use the --extractor
option to specify a particular template. The template must be located at ytdl_nfo/configs/<EXTRACTOR_TEMPLATE_NAME>.yaml
.
python3 -m ytdl_nfo [-h] [--config] [-e EXTRACTOR] [--regex REGEX] [-w] JSON_FILE
positional arguments:
JSON_FILE JSON file to convert or directory to process recursively
options:
-h, --help show this help message and exit
--config Show the path to the config directory
-e EXTRACTOR, --extractor EXTRACTOR
Specify specific extractor
-r, --regex REGEX A regular expression used to search for JSON source files
-w, --overwrite Overwrite existing NFO files
# Display the configuration location
ytdl-nfo --config
# Create a single NFO file using metadata from `great_video.info.json`
ytdl-nfo great_video.info.json
# Create an NFO file for each `.info.json` file located in the `video_folder` directory
# (provided a matching extractor template exists in the `ytdl_nfo/configs` directory)
ytdl-nfo video_folder
# Create a single NFO file using metadata from `great_video.info.json` and the `custom_extractor_name` template
ytdl-nfo --extractor custom_extractor_name great_video.info.json
This is a small project I started to learn how to use the Python packaging system whilst providing some useful functionality for my home server setup. Issues/Pull Requests and constructive criticism are welcome.
-
Install Python 3.8 (or later)
-
Install Python Poetry
-
Create a fork of this repo
-
Clone your fork using
git clone [email protected]:<YOUR_USERNAME>/ytdl-nfo.git
-
Change to the project directory and initialize the environment using poetry
cd ytdl-nfo poetry install
-
Run the application using
poetry run ytdl-nfo
, or usepoetry shell
to enter the virtual env
- 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