all repos — auto-movie-tagger @ db016be7a4ea96a304744e4a4bd5f59214d5d757

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

Added shlex to split command

Using shlex ensures having proper arguments being passed to the system call. I found that the earlier implementaion did not work on linux.
prithugoswami prithugoswami524@gmail.com
Wed, 03 Jan 2018 17:01:19 +0530
commit

db016be7a4ea96a304744e4a4bd5f59214d5d757

parent

3161c4b1058b156f8bd37f2f475d80ac69e0bdeb

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M amt.pyamt.py

@@ -163,7 +163,7 @@ '-metadata:s:s:0 language=eng '

'-metadata:s:a:0 handler="" ' '-metadata:s:v:0 handler="" "' + newfilename + '"') - subprocess.run(command) + subprocess.run(shlex.split(command)) if mode == 3: command = ('ffmpeg -i "' + filename

@@ -173,7 +173,7 @@ '-metadata:s:s:0 language=eng '

'-metadata:s:a:0 handler="" ' '-metadata:s:v:0 handler="" ' '"' + newfilename + '"') - subprocess.run(command) + subprocess.run(shlex.split(command)) # the poster is fetched from tmdb only if there is no file # named " filename + '.jpg' " in the working directory

@@ -222,7 +222,7 @@ except OverflowError:

remove_meta_command = ('ffmpeg -i "' + newfilename + '" -codec copy -map_metadata -1 "' + newfilename[:-4] + 'new.mp4"') - subprocess.run(remove_meta_command) + subprocess.run(shlex.split(remove_meta_command)) video_new = MP4(newfilename[:-4] + 'new.mp4') with open(poster_filename, "rb") as f: video_new["covr"] = [MP4Cover(