Browse Source

Add '--embed-thumbnail' option, closes #124

doc-issue-template
MrS0m30n3 7 years ago
parent
commit
45a30706bb
3 changed files with 11 additions and 2 deletions
  1. 4
      youtube_dl_gui/optionsframe.py
  2. 6
      youtube_dl_gui/optionsmanager.py
  3. 3
      youtube_dl_gui/parsers.py

4
youtube_dl_gui/optionsframe.py

@ -476,6 +476,7 @@ class FormatsTab(TabPanel):
self.post_proc_opts_label = self.crt_statictext("Post-Process options")
self.keep_video_checkbox = self.crt_checkbox("Keep original files")
self.extract_audio_checkbox = self.crt_checkbox("Extract audio from video file")
self.embed_thumbnail_checkbox = self.crt_checkbox("Embed thumbnail in audio file")
self.audio_quality_label = self.crt_statictext("Audio quality")
self.audio_quality_combobox = self.crt_combobox(list(self.AUDIO_QUALITY.values()))
@ -495,6 +496,7 @@ class FormatsTab(TabPanel):
vertical_sizer.Add(self.post_proc_opts_label, flag=wx.TOP, border=5)
vertical_sizer.Add(self.keep_video_checkbox, flag=wx.ALL, border=5)
vertical_sizer.Add(self.extract_audio_checkbox, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5)
vertical_sizer.Add(self.embed_thumbnail_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)
@ -514,6 +516,7 @@ class FormatsTab(TabPanel):
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"])
self.embed_thumbnail_checkbox.SetValue(self.opt_manager.options["embed_thumbnail"])
def save_options(self):
checked_video_formats = [VIDEO_FORMATS[vformat] for vformat in self.video_formats_checklistbox.GetCheckedStrings()]
@ -523,6 +526,7 @@ class FormatsTab(TabPanel):
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()
self.opt_manager.options["embed_thumbnail"] = self.embed_thumbnail_checkbox.GetValue()
class DownloadsTab(TabPanel):

6
youtube_dl_gui/optionsmanager.py

@ -225,6 +225,9 @@ class OptionsManager(object):
nomtime (boolean): When True will not use the Last-modified header to
set the file modification time.
embed_thumbnail (boolean): When True will embed the thumbnail in
the audio file as cover art.
"""
#TODO Remove old options & check options validation
self.options = {
@ -288,7 +291,8 @@ class OptionsManager(object):
'native_hls': True,
'show_completion_popup': True,
'confirm_deletion': True,
'nomtime': False
'nomtime': False,
'embed_thumbnail': False
}
def load_from_file(self):

3
youtube_dl_gui/parsers.py

@ -104,7 +104,8 @@ class OptionsParser(object):
OptionHolder('youtube_dl_debug', '-v', False),
OptionHolder('ignore_config', '--ignore-config', False),
OptionHolder('native_hls', '--hls-prefer-native', False),
OptionHolder('nomtime', '--no-mtime', False)
OptionHolder('nomtime', '--no-mtime', False),
OptionHolder('embed_thumbnail', '--embed-thumbnail', False)
]
def parse(self, options_dictionary):

Loading…
Cancel
Save