all repos — auto-movie-tagger @ 3161c4b1058b156f8bd37f2f475d80ac69e0bdeb

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

Added better Exception Handler
prithugoswami prithugoswami524@gmail.com
Wed, 03 Jan 2018 16:49:30 +0530
commit

3161c4b1058b156f8bd37f2f475d80ac69e0bdeb

parent

a17bb764997842edbef3818da90fe8a3617d7af6

1 files changed, 14 insertions(+), 0 deletions(-)

jump to
M amt.pyamt.py

@@ -23,9 +23,22 @@ """

import os import subprocess import urllib +import shlex +import linecache +import sys import tmdbsimple as tmdb from imdbpie import Imdb from mutagen.mp4 import MP4, MP4Cover + + +def PrintException(): + exc_type, exc_obj, tb = sys.exc_info() + f = tb.tb_frame + lineno = tb.tb_lineno + fname = f.f_code.co_filename + linecache.checkcache(fname) + line = linecache.getline(fname, lineno, f.f_globals) + print ('\nEXCEPTION IN ({}, LINE {} "{}"): {}'.format(fname, lineno, line.strip(), exc_obj)) # Setting the API key for usage of TMDB API

@@ -246,6 +259,7 @@ print('\nSome error occured while processing '

+ filename + '\n\n====================================================') errored_files.append(filename + ' - ' + str(e)) + PrintException() mp4_filenames = []