https://github.com/dinoosauro/infojson-metadata-add
Add metadata to a video/audio file from the ".info.json" file generated by yt-dlp.
https://github.com/dinoosauro/infojson-metadata-add
audio-metadata json metadata video-metadata youtube-dl yt-dlp
Last synced: 4 months ago
JSON representation
Add metadata to a video/audio file from the ".info.json" file generated by yt-dlp.
- Host: GitHub
- URL: https://github.com/dinoosauro/infojson-metadata-add
- Owner: dinoosauro
- License: mit
- Created: 2024-08-21T19:45:40.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T20:14:02.000Z (10 months ago)
- Last Synced: 2025-01-03T11:17:41.572Z (5 months ago)
- Topics: audio-metadata, json, metadata, video-metadata, youtube-dl, yt-dlp
- Language: C#
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 pathSo:
- `*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:
- [TagLib-Sharp](https://github.com/mono/taglib-sharp) – LGPL 2.1
- [ImageSharp](https://github.com/SixLabors/ImageSharp) – Six Labors Split
License