Skip to content

Latest commit

 

History

History
78 lines (60 loc) · 5.39 KB

README.md

File metadata and controls

78 lines (60 loc) · 5.39 KB

infojson-metadata-add

Add metadata to a video/audio file from the ".info.json" file generated by yt-dlp.

Installation

You can download pre-built binaries of the script from the "Releases" tab. These executables are generated automatically from GitHub Workflows.

If you want to build it yourself, clone the repository, and restore the dependencies (TagLib-Sharp + SixLabors.ImageSharp). Then, move to ConsoleApp and publish a release file using the dontet publish command from the .NET SDK (8).

Commands

This software is ran from the command line. As the first argument, you need to specify how the files should be fetched:

  • --folder: the app will convert all the files in the provided folder (in the next argument). Make sure to specify later the extension of the video/audio files
  • --thumbnail: you'll provide manually the files. With this command, the thumbnail will be merged. Provide, in the following order:
    • The info.json file path
    • The video/audio file path
    • The thumbnail file path
    • The mimetype of the thumbnail
  • --file: you'll provide manually the files. With this command, no thumbnail will be merged. Provide, in the following order:
    • The info.json file path
    • The video/audio file path

So:

  • *ApplicationPath* --folder *FolderPath* --file-extension "mp4" will merge the metadata of all the MP4 files in the FolderPath (and in its subfolders)

  • *ApplicationPath* --thumbnail *InfoJsonPath* *VideoPath* *ThumbnailPath* *MimeType* will fetch metadata from InfoJsonPath, and will add it in the VideoPath. It'll also add the thumbnail to the video, fetched from ThumbnailPath. If the thumbnail is a WebP, you can add image/webp as the mimetype. If it's a JPEG/JPG, you can add image/jpeg and so on.

  • *ApplicationPath* --file *InfoJsonPath* *VideoPath* will fetch metadata from InfoJsonPath, and will add it in the VideoPath.

Settings

After those arguments, you can add extra settings. You can find in the table below what they do:

Argument Description The next argument Default
--extra Add more metadata to the file using custom properties (see below) true to enable, false to disable true
--prefer-tags For the genre, use the video's tags instead of the suggested category true to enable, false to disable false
--thumbnail-convert

--albumart-convert

-c
Re-encode the image to a JPEG image true to enable, false to disable true
--albumart-quality

--thumbnail-quality

-q
Set the quality of the re-encoded JPEG image An integer, from 1 to 100 75
--description-as-comment Add the video description in the Comment tag true to enable, false to disable false
--description-in-description Add the video description in the Description tag true to enable, false to disable true
--fulldate

--full-date

-d
In the Date tag, add the full date (YYYYMMDD) instead of only the year true to enable, false to disable false
--purl Add the PURL extra metadata tag (where yt-dlp adds the video URL) true to enable, false to disable true
--subfolders

-s
Fetch items also in the subfolders true to enable, false to disable true
--files-extension

--file-extension

-f
The file extension of the video/audio file to merge. This should be provided only if an entire directory is passed A string with the file extension webm
--download-album-art

--download-thumbnail

-t
Download the album art if it can't be found (or if it has not been provided) true to enable, false to disable false

## Open Source

This project is published under the MIT License. I created this just because I found that it could be useful to embed metatada on some files that I have already downloaded.

This application uses two open-source libraries: