all repos — auto-movie-tagger @ master

A Python script that auto tags and adds poster to mkv or mp4 movie files.

add new sub codec in blacklist
Tue, 06 Nov 2018 23:59:08 +0530
added subtitle blacklist tuple

also added dvd_subtitle to blacklist
Mon, 09 Jul 2018 00:23:40 +0530
update readme
Tue, 26 Jun 2018 13:12:56 +0530
# Auto Movie Tagger
A Python script that auto tags and adds poster to MKV or MP4 movie files.  
Also adds subtitles if provided.  

The metadata it adds:
+ Genre - Movie's genres
+ Year - The release year of the movie
+ Comment - IMDb Rating and the movie's plot-outline.


## Requirements

    <li>python 3.x</li>
    <li><a href="">ffmpeg</a> - A cli-tool that can encode/decode media files</li>
    <li><a href="">imdbpie</a> - A Python module for IMDb</li>
    <li><a href="">tmdbsimple</a> - A Python module which is a wrapper for The Movie Database API v3</li>
    <li><a href="">mutagen</a> - Python module to handle media files' metadata</li>

><h3>Note for installing python 3 dependencies</h3>
>This script is compatible for python3 only. If you are on Ubuntu or any other distro/OS with python2.x and python3.x both installed, make sure you use 'pip3' command to install the python modules. On Ubuntu/Debian-based distros you can run:</p>
><pre>sudo apt-get install pip3</pre>
>and then install the dependencies:
><pre>pip3 install &lt;module&gt;</pre>

## Installing ffmpeg
You can download ffmpeg for your platform <a href="">from here</a>. Most of the linux distributions come with it ffmpeg pre-installed, or you can always look for the package in your distro's package repository.  
<a href="">Compilation Guide for ffmpeg</a>  
Here's a <a href="">wikiHow article on how to install ffmpeg on Windows</a>

## Installing Python module dependencies
<pre>pip install imdbpie tmdbsimple mutagen</pre>

## How to use
  <li>Move all the movie files you want to be tagged into one folder. Make sure that the filename is the correct title of the movie. Year of the title can also be included.</li>
  <li>If you want subtitles to be embedded into the movie file(s) then add a subtitle file (.srt only) in the same folder named exactly the same as the movie file(s).</li>
  <li>Download the script (<a href=""></a>) and run it in that directory and sit back and relax till it ends executing. How to run the script in that directory? Copy the script in the directory and run it using the command:
  Ubuntu users with python2.x and python3.x both installed, make sure the depedences are installed using <code>pip3 install &lt;module&gt;</code> and then run the script using:  

## Notes
  <li>This script only works for mp4 and mkv file types.</li>
  <li>The final file is always a MP4 file.</li>
  <li>Make sure if you are having a MKV file, it should not contain picture based subtitles (hdmv-pgs/vobsub,etc) as MP4 files do not support picture based subtitles. You can use <a href="">MKVToolNix</a> or any other similar GUI utility to quickly remove the picture based subtitles or you can use ffmpeg to this as well. If the file already has an SRT subtitle then the script will just copy it.</li>
  <li>If you would like to use your own poster image then add an image file (jpg only) in the same folder and rename it to the same name as the movie file.</li>
  <li>Although I have provided my own TMDb API key in the source, I would recommend you get you own from <a href="">here</a></li>
  <li> Tip - When you sort your tagged movies according to the comment they get sorted by ascending/descending order of their IMDb rating.</li>

## Tooltips for Windows Users

To make the tooltip show the movie's genre and IMDb rating and plot-outline like in the screenshot, you will have to make some changes in the registry of your windows machine.
1. Fire up your _Registry Editor_. Open the _Run_ window (Win + R) and type "regedit"
2. Head over to <strong>HKEY_CLASSES_ROOT\SystemFileAssociations\\.mp4</strong>
3. From the left panel right click on the "<strong>InfoTip</strong>" value name and click "<strong>Modify...</strong>"
4. Under the "<strong>Value Data</strong>" field add the attributes, "System.Music.Genre" and "System.Comment" anywhere you like depending how you would like the metadata to show in the tool tip. The "<strong>Value Data</strong>" filed consists of different attributes that appear in the tooltip. For example "System.Media.Duration" is the Duration of the media. These attributes are separated by ";" (semicolon). I would recommend adding the Genre and Comment attributes after "System.Media.Duration".
git clone