From 26662e3ba25fdcbadd7f0aa1fec28856962cc609 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Mon, 14 Nov 2016 16:51:15 +0200 Subject: [PATCH] Add '--hls-prefer-native' option under Extra tab --- TODO | 1 - youtube_dl_gui/optionsframe.py | 5 +++++ youtube_dl_gui/optionsmanager.py | 5 ++++- youtube_dl_gui/parsers.py | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index 72e1543..8139752 100644 --- a/TODO +++ b/TODO @@ -34,7 +34,6 @@ Options * Option to disable-enable the 'download finished' pop up message * Option to enable-disable items deletion from the filesystem * Option to validate item deletion 'Are you sure?' -* Add 'native hls option' see issue #49 * Localization option: add country flags * Add '--recode-video' to Formats tab diff --git a/youtube_dl_gui/optionsframe.py b/youtube_dl_gui/optionsframe.py index 91755d7..73d4bf8 100644 --- a/youtube_dl_gui/optionsframe.py +++ b/youtube_dl_gui/optionsframe.py @@ -821,6 +821,7 @@ class ExtraTab(TabPanel): self.ignore_errors_checkbox = self.crt_checkbox("Ignore errors") self.youtube_dl_debug_checkbox = self.crt_checkbox("Debug youtube-dl") self.ignore_config_checkbox = self.crt_checkbox("Ignore youtube-dl config") + self.native_hls_checkbox = self.crt_checkbox("Prefer native HLS") self._set_layout() @@ -839,6 +840,8 @@ class ExtraTab(TabPanel): extra_opts_sizer.Add(self.ignore_config_checkbox) extra_opts_sizer.AddSpacer((5, -1)) extra_opts_sizer.Add(self.youtube_dl_debug_checkbox) + extra_opts_sizer.AddSpacer((5, -1)) + extra_opts_sizer.Add(self.native_hls_checkbox) vertical_sizer.Add(extra_opts_sizer, flag=wx.ALL, border=5) @@ -850,12 +853,14 @@ class ExtraTab(TabPanel): self.ignore_errors_checkbox.SetValue(self.opt_manager.options["ignore_errors"]) self.youtube_dl_debug_checkbox.SetValue(self.opt_manager.options["youtube_dl_debug"]) self.ignore_config_checkbox.SetValue(self.opt_manager.options["ignore_config"]) + self.native_hls_checkbox.SetValue(self.opt_manager.options["native_hls"]) def save_options(self): self.opt_manager.options["cmd_args"] = self.cmdline_args_textctrl.GetValue() self.opt_manager.options["ignore_errors"] = self.ignore_errors_checkbox.GetValue() self.opt_manager.options["youtube_dl_debug"] = self.youtube_dl_debug_checkbox.GetValue() self.opt_manager.options["ignore_config"] = self.ignore_config_checkbox.GetValue() + self.opt_manager.options["native_hls"] = self.native_hls_checkbox.GetValue() class LogGUI(wx.Frame): diff --git a/youtube_dl_gui/optionsmanager.py b/youtube_dl_gui/optionsmanager.py index 8063df6..a6feacc 100644 --- a/youtube_dl_gui/optionsmanager.py +++ b/youtube_dl_gui/optionsmanager.py @@ -215,6 +215,8 @@ class OptionsManager(object): confirm_exit (boolean): When True create popup to confirm exiting youtube-dl-gui. + native_hls (boolean): When True youtube-dl will use the native HLS implementation. + """ #TODO Remove old options & check options validation self.options = { @@ -274,7 +276,8 @@ class OptionsManager(object): 'selected_format': '0', 'youtube_dl_debug': False, 'ignore_config': True, - 'confirm_exit': True + 'confirm_exit': True, + 'native_hls': True } def load_from_file(self): diff --git a/youtube_dl_gui/parsers.py b/youtube_dl_gui/parsers.py index 4aab0ac..18eede2 100644 --- a/youtube_dl_gui/parsers.py +++ b/youtube_dl_gui/parsers.py @@ -102,7 +102,8 @@ class OptionsParser(object): OptionHolder('subs_lang', '--sub-lang', '', ['write_subs']), OptionHolder('audio_quality', '--audio-quality', '5', ['to_audio']), OptionHolder('youtube_dl_debug', '-v', False), - OptionHolder('ignore_config', '--ignore-config', False) + OptionHolder('ignore_config', '--ignore-config', False), + OptionHolder('native_hls', '--hls-prefer-native', False) ] def parse(self, options_dictionary):