Extract final extension after ffmpeg recoding process

This commit is contained in:
MrS0m30n3 2017-07-05 01:18:27 +03:00
parent 16bffd69f6
commit b1d0543106

View File

@ -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