From b1d0543106b08314acbf861b1b13f688f309ad8a Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Wed, 5 Jul 2017 01:18:27 +0300 Subject: [PATCH] Extract final extension after ffmpeg recoding process --- youtube_dl_gui/downloaders.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/youtube_dl_gui/downloaders.py b/youtube_dl_gui/downloaders.py index 907199c..638e88e 100644 --- a/youtube_dl_gui/downloaders.py +++ b/youtube_dl_gui/downloaders.py @@ -360,6 +360,7 @@ def extract_data(stdout): 'playlist_size' : The number of videos in the playlist. """ + # REFACTOR def extract_filename(input_data): path, fullname = os.path.split(input_data.strip("\"")) filename, extension = os.path.splitext(fullname) @@ -460,6 +461,14 @@ def extract_data(stdout): data_dictionary['filename'] = filename data_dictionary['extension'] = extension + # Get final extension after recoding process + if stdout[1] == 'Converting': + path, filename, extension = extract_filename(' '.join(stdout_with_spaces[8:])) + + data_dictionary['path'] = path + data_dictionary['filename'] = filename + data_dictionary['extension'] = extension + elif stdout[0][0] != '[' or stdout[0] == '[debug]': pass # Just ignore this output