From b2209bf621879ce864cd53da200bc1ddc7772686 Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sun, 23 Oct 2016 17:46:25 +0300 Subject: [PATCH] Add 'extract audio from video' option --- youtube_dl_gui/optionsframe.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl_gui/optionsframe.py b/youtube_dl_gui/optionsframe.py index 14a6cd3..94f873c 100644 --- a/youtube_dl_gui/optionsframe.py +++ b/youtube_dl_gui/optionsframe.py @@ -435,6 +435,7 @@ class FormatsTab(TabPanel): self.post_proc_opts_label = self.crt_statictext("Post-Process options") self.keep_video_checkbox = self.crt_checkbox("Keep original video") + self.extract_audio_checkbox = self.crt_checkbox("Extract audio from video file") self.audio_quality_label = self.crt_statictext("Audio quality") self.audio_quality_combobox = self.crt_combobox(list(self.AUDIO_QUALITY.values())) @@ -452,7 +453,8 @@ class FormatsTab(TabPanel): vertical_sizer.Add(self.audio_formats_checklistbox, 1, wx.EXPAND | wx.ALL, border=5) vertical_sizer.Add(self.post_proc_opts_label) - vertical_sizer.Add(self.keep_video_checkbox, flag=wx.ALL, border=5) + vertical_sizer.Add(self.keep_video_checkbox, flag=wx.LEFT | wx.RIGHT | wx.TOP, border=5) + vertical_sizer.Add(self.extract_audio_checkbox, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) audio_quality_sizer = wx.BoxSizer(wx.HORIZONTAL) audio_quality_sizer.Add(self.audio_quality_label, flag=wx.ALIGN_CENTER_VERTICAL) @@ -471,6 +473,7 @@ class FormatsTab(TabPanel): self.audio_formats_checklistbox.SetCheckedStrings(checked_audio_formats) self.keep_video_checkbox.SetValue(self.opt_manager.options["keep_video"]) self.audio_quality_combobox.SetValue(self.AUDIO_QUALITY[self.opt_manager.options["audio_quality"]]) + self.extract_audio_checkbox.SetValue(self.opt_manager.options["to_audio"]) def save_options(self): checked_video_formats = [VIDEO_FORMATS[vformat] for vformat in self.video_formats_checklistbox.GetCheckedStrings()] @@ -479,6 +482,7 @@ class FormatsTab(TabPanel): self.opt_manager.options["selected_audio_formats"] = checked_audio_formats self.opt_manager.options["keep_video"] = self.keep_video_checkbox.GetValue() self.opt_manager.options["audio_quality"] = self.AUDIO_QUALITY[self.audio_quality_combobox.GetValue()] + self.opt_manager.options["to_audio"] = self.extract_audio_checkbox.GetValue() class DownloadsTab(TabPanel):