Browse Source

Extract final extension after ffmpeg recoding process

doc-issue-template
MrS0m30n3 7 years ago
parent
commit
b1d0543106
1 changed files with 9 additions and 0 deletions
  1. 9
      youtube_dl_gui/downloaders.py

9
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

Loading…
Cancel
Save