Giter Site home page Giter Site logo

dropcreations / mkvtagger Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 4.0 50 KB

Python script to tag MKV and WebM media files using mkvpropedit from MKVToolNix with the support of official matroska tags and multiple tag values

License: MIT License

Python 100.00%
mkvpropedit mkvtoolnix xml mkv webm tagger xml-tags mkv-tags webm-tags multiple

mkvtagger's Introduction

mkvtagger

A python program to tag MKV & WebM media files using mkvpropedit from MKVToolNix.

Matroska

Features

  • Adds official Matroska tags as well as unofficial custom tags.
  • Can add tag values as a single tag value or multiple tag values.
  • Removes encoded date, writing application, writing library tags if you need.
  • Refer here for official tag names.

How to use?

First of all clone this project or download the project as a zip file and extract it to your pc (Windows users can see Releases. Make sure you have mkvpropedit in your system PATH.

git clone https://github.com/dropcreations/mkvtagger.git && cd mkvtagger

Install required modules for python (use pip3 if pip doesn't work for you), This program uses only one module from outside.

pip install rich

You can add tags by a text file .txt. If you don't need a text file to add tags, you can simply add tags when console asked. If you're using a text file, text file's content must be formatted as below.

TAG NAME: TAG VALUE
TAG NAME: TAG VALUE, TAG VALUE
.
.

and use -t or --tags argument as below.

python mkvtagger.py -t [text_file.txt] [inputs]

If you want to add tag values as multiple tags, use -m or --multi parameter as below.

python mkvtagger.py -m [input]

You can tag bulk files at once with the same tag-value pairs. Folder input is also support as wells as file input. If you have a folder containing .mkv and .webm files that you want to tag each as same. Put the folder path as the input. That folder can contain any other files. no matter. this script filters the .mkv and .webm files. You can add multiple inputs as below.

python mkvtagger.py [input-file] [input-file] [input-folder] [input-folder]

Get help using -h or --help parameter

usage: mkvtagger.py [-h] [-v] [-m] [-t TAGS] [--no-encoded-date] [--no-writing-application]
                    [--no-writing-library] [inputs ...]

Tag MKV/WebM files with OFFICIAL or UNOFFICIAL tags with multiple tag value support.

positional arguments:
  inputs                        Add input files or folders

optional arguments:
  -h, --help                    show this help message and exit
  -v, --version                 show program's version number and exit
  -m, --multi                   Use multiple tag values
  -t TAGS, --tags TAGS          Add tags from a text file
  --no-encoded-date             Remove encoded date
  --no-writing-application      Remove writing application
  --no-writing-library          Remove writing library

About me

Hi, You might recognize me as GitHub's dropcreations.

Other useful python scripts done by me

Project Github location
MKVExtractor https://github.com/dropcreations/MKVExtractor
FLAC-Tagger https://github.com/dropcreations/FLAC-Tagger
MP4/M4A-Tagger https://github.com/dropcreations/MP4-Tagger
Apple-Music-Tagger https://github.com/dropcreations/Apple-Music-Tagger

  • NOTE: If you found any issue using this script mention in issues section

mkvtagger's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mkvtagger's Issues

Metadata tag values with a colon are truncated

Kodi and other tools support the TMDBURL and IMDBURL metadata tags. mkvtagger won't properly apply tags from a file that include a colon as it seems to consider it the start of another tag. I've also tried quoting the value to no effect.

Example:

Input file:

IMDB: tt1696822
IMDBURL: https://www.imdb.com/title/tt1696822
TMDB: tv/25394
TMDBURL: https://www.themoviedb.org/tv/25394-how-the-earth-was-made/season/1/episode/3

Resulting tags:

IMDB                                     : tt1696822
IMDBURL                                  : https
TMDB                                     : tv/25394
TMDBURL                                  : https

Question: nested tags?

Can a text file add nested tags like:
actor Toshiro Mifune
character Kikuchiyo
actor Takashi Shimura

   character Kambei Shimada

According to the Matroska site, nested tag becomes an attribute of the 'outer' tag, i.e. character becomes an attribute of actor.
How would nested tags be handled?

Metadata tag values with a colon are truncated

Kodi and other tools support the TMDBURL and IMDBURL metadata tags. mkvtagger won't properly apply tags from a file that include a colon as it seems to consider it the start of another tag. I've also tried quoting the value to no effect.

Example:

Input file:

IMDB: tt1696822
IMDBURL: https://www.imdb.com/title/tt1696822
TMDB: tv/25394
TMDBURL: https://www.themoviedb.org/tv/25394-how-the-earth-was-made/season/1/episode/3

Resulting tags:

IMDB                                     : tt1696822
IMDBURL                                  : https
TMDB                                     : tv/25394
TMDBURL                                  : https

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.