all repos — auto-movie-tagger @ ee7fe7b1a53be00143ec04c2089a74a414fbe93e

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

added subtitle blacklist tuple

also added dvd_subtitle to blacklist
prithugoswami prithugoswami524@gmail.com
Mon, 09 Jul 2018 00:23:40 +0530
commit

ee7fe7b1a53be00143ec04c2089a74a414fbe93e

parent

b0d7f19ba3b3f921f298c04aceb45212fc84b367

1 files changed, 4 insertions(+), 2 deletions(-)

jump to
M amt.pyamt.py

@@ -20,6 +20,9 @@ import tmdbsimple as tmdb

from imdbpie import Imdb from mutagen.mp4 import MP4, MP4Cover +# The following subtitle codecs are ingored if found in the file as they are +# not supported by the mp4 container. These are mainly picture-based subtitles +sub_codec_blacklist = ("dvdsub", "dvd_subtitle", "pgssub") def collect_stream_metadata(filename): """

@@ -36,7 +39,6 @@ json_data = JSONDecoder().decode(out)

return json_data - def PrintException(): exc_type, exc_obj, tb = sys.exc_info()

@@ -122,7 +124,7 @@ stream_md = collect_stream_metadata(filename)

streams_to_process = [] dvdsub_exists=False for stream in stream_md['streams']: - if not stream['codec_name'] in ("dvdsub", "pgssub"): + if not stream['codec_name'] in sub_codec_blacklist: streams_to_process.append(stream['index']) else: dvdsub_exists=True