Browse Source

Remove 'clear dash files' option under video tab

https://github.com/rg3/youtube-dl/issues/2108#issuecomment-49556100
doc-issue-template
MrS0m30n3 10 years ago
parent
commit
6d200bd9a8
5 changed files with 2 additions and 36 deletions
  1. 11
      youtube_dl_gui/DownloadObject.py
  2. 3
      youtube_dl_gui/DownloadThread.py
  3. 19
      youtube_dl_gui/OptionsFrame.py
  4. 1
      youtube_dl_gui/OptionsManager.py
  5. 4
      youtube_dl_gui/OptionsParser.py

11
youtube_dl_gui/DownloadObject.py

@ -32,11 +32,6 @@ class DownloadObject(object):
Return: None
clear_dash()
Params: None
Return: None
Properties
files_list: Python list that contains all the files DownloadObject
instance has downloaded.
@ -114,12 +109,6 @@ class DownloadObject(object):
self._proc.kill()
self._return_code = self.STOPPED
def clear_dash(self):
''' Clear DASH files after ffmpeg mux. '''
for dash_file in self._files_list:
if os.path.exists(dash_file):
os.remove(dash_file)
def _update_data(self, data):
''' Update self._data from data.
Return True if updated else return False.

3
youtube_dl_gui/DownloadThread.py

@ -208,9 +208,6 @@ class DownloadThread(Thread):
return_code = self._downloader.download(self.url, options)
if self.opt_manager.options['clear_dash_files']:
self._downloader.clear_dash()
if return_code == DownloadObject.OK:
self._callafter({'status': 'Finished'})
elif return_code == DownloadObject.ERROR:

19
youtube_dl_gui/OptionsFrame.py

@ -532,11 +532,9 @@ class AudioPanel(wx.Panel):
def OnAudioCheck(self, event):
''' Event handler for self.to_audio_checkbox. '''
if self.to_audio_checkbox.GetValue():
self.keep_video_checkbox.Enable()
self.audio_format_combo.Enable()
self.audio_quality_combo.Enable()
else:
self.keep_video_checkbox.Disable()
self.audio_format_combo.Disable()
self.audio_quality_combo.Disable()
@ -570,7 +568,6 @@ class VideoPanel(wx.Panel):
self.video_format_combo = wx.ComboBox(self, choices=VIDEO_FORMATS, size=(180, 30))
self.dash_audio_combo = wx.ComboBox(self, choices=DASH_AUDIO_FORMATS, size=(180, 30))
self.clear_dash_checkbox = wx.CheckBox(self, label='Clear DASH audio/video files', size=WX_CHECKBOX_SIZE)
main_sizer = wx.BoxSizer(wx.VERTICAL)
@ -582,21 +579,10 @@ class VideoPanel(wx.Panel):
main_sizer.Add(wx.StaticText(self, label='DASH Audio'), flag=wx.ALIGN_CENTER_HORIZONTAL)
main_sizer.AddSpacer(5)
main_sizer.Add(self.dash_audio_combo, flag=wx.ALIGN_CENTER_HORIZONTAL)
main_sizer.AddSpacer(20)
main_sizer.Add(self.clear_dash_checkbox, flag=wx.ALIGN_CENTER_HORIZONTAL)
self.SetSizer(main_sizer)
self.Bind(wx.EVT_COMBOBOX, self.OnVideoFormatPick, self.video_format_combo)
self.Bind(wx.EVT_COMBOBOX, self.OnAudioFormatPick, self.dash_audio_combo)
def OnAudioFormatPick(self, event):
''' Event handler for self.dash_audio_combo. '''
if is_dash(self.dash_audio_combo.GetValue()):
self.clear_dash_checkbox.Enable()
else:
self.clear_dash_checkbox.SetValue(False)
self.clear_dash_checkbox.Disable()
def OnVideoFormatPick(self, event):
''' Event handler for self.video_format_combo. '''
@ -604,22 +590,17 @@ class VideoPanel(wx.Panel):
self.dash_audio_combo.Enable()
else:
self.dash_audio_combo.Disable()
self.clear_dash_checkbox.Disable()
self.clear_dash_checkbox.SetValue(False)
self.OnAudioFormatPick(None)
def load_options(self, opt_manager):
''' Load panel options from OptionsHandler object. '''
self.video_format_combo.SetValue(opt_manager.options['video_format'])
self.dash_audio_combo.SetValue(opt_manager.options['dash_audio_format'])
self.clear_dash_checkbox.SetValue(opt_manager.options['clear_dash_files'])
self.OnVideoFormatPick(None)
def save_options(self, opt_manager):
''' Save panel options to OptionsHandler object. '''
opt_manager.options['video_format'] = self.video_format_combo.GetValue()
opt_manager.options['dash_audio_format'] = self.dash_audio_combo.GetValue()
opt_manager.options['clear_dash_files'] = self.clear_dash_checkbox.GetValue()
class OutputPanel(wx.Panel):

1
youtube_dl_gui/OptionsManager.py

@ -58,7 +58,6 @@ class OptionsManager(object):
'save_path': get_home(),
'video_format': 'default',
'dash_audio_format': 'none',
'clear_dash_files': False,
'to_audio': False,
'keep_video': False,
'audio_format': 'mp3',

4
youtube_dl_gui/OptionsParser.py

@ -210,8 +210,8 @@ class OptionsParser():
if self._options['audio_quality'] != 'mid':
self.options_list.append('--audio-quality')
self.options_list.append(AUDIO_QUALITY[self._options['audio_quality']])
if self._options['keep_video']:
self.options_list.append('-k')
if self._options['keep_video']:
self.options_list.append('-k')
def _set_other_options(self):
if self._options['cmd_args'] != '':

Loading…
Cancel
Save