From 9059338a1dedc064605b02e107669c194e33b196 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Wed, 4 Mar 2015 19:26:32 +0200 Subject: [PATCH] Fix filename extraction --- youtube_dl_gui/downloaders.py | 2 +- youtube_dl_gui/optionsmanager.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/youtube_dl_gui/downloaders.py b/youtube_dl_gui/downloaders.py index a5411d9..206fa00 100644 --- a/youtube_dl_gui/downloaders.py +++ b/youtube_dl_gui/downloaders.py @@ -292,7 +292,7 @@ def extract_data(stdout): # Get filename if stdout[1] == 'Destination:': - data_dictionary['filename'] = ' '.join(stdout[1:]) + data_dictionary['filename'] = ' '.join(stdout[2:]) # Get progress info if '%' in stdout[1]: diff --git a/youtube_dl_gui/optionsmanager.py b/youtube_dl_gui/optionsmanager.py index 3264d29..6e332ad 100644 --- a/youtube_dl_gui/optionsmanager.py +++ b/youtube_dl_gui/optionsmanager.py @@ -175,10 +175,10 @@ class OptionsManager(object): the LogManager. See main() function under __init__(). log_time (boolean): See logmanager.LogManager add_time attribute. - + workers_number (int): Number of download workers that download manager will spawn. Must be greater than zero. - + locale_name (string): Locale name (e.g. ru_RU). """ @@ -235,7 +235,7 @@ class OptionsManager(object): with open(self.settings_file, 'rb') as settings_file: try: options = json.load(settings_file) - + if self._settings_are_valid(options): self.options = options except: @@ -277,11 +277,11 @@ class OptionsManager(object): VALID_FILESIZE_UNIT = ('', 'k', 'm', 'g', 't', 'p', 'e', 'z', 'y') VALID_SUB_LANGUAGE = ('en', 'gr', 'pt', 'fr', 'it', 'ru', 'es', 'de') - + for key in self.options: if key not in settings_dictionary: return False - + # Check if each key has a valid value rules_dict = { 'video_format': VALID_VIDEO_FORMAT, @@ -297,9 +297,9 @@ class OptionsManager(object): for key, valid_list in rules_dict.items(): if settings_dictionary[key] not in valid_list: return False - + settings_dictionary['workers_number'] = int(settings_dictionary['workers_number']) - + if settings_dictionary['workers_number'] < 1: return False