aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_gui.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-12-12 17:49:10 -0500
committerJesús <heckyel@hyperbola.info>2019-12-12 17:49:10 -0500
commit74bc4d473c29783099f2f1dee97b87f26237005d (patch)
tree46497a2f16481c28ea914cd1b2e4261bfac1870c /hypervideo_gui.py
parent7b84bccefe56a893c716dfc41130a6f81657db35 (diff)
downloadhypervideo-gui-74bc4d473c29783099f2f1dee97b87f26237005d.tar.lz
hypervideo-gui-74bc4d473c29783099f2f1dee97b87f26237005d.tar.xz
hypervideo-gui-74bc4d473c29783099f2f1dee97b87f26237005d.zip
Fix: 'In the available formats, it does not notify if it includes video or only audio-only webm' issue for @quiliro
Diffstat (limited to 'hypervideo_gui.py')
-rw-r--r--hypervideo_gui.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/hypervideo_gui.py b/hypervideo_gui.py
index 4830004..c668d27 100644
--- a/hypervideo_gui.py
+++ b/hypervideo_gui.py
@@ -251,14 +251,25 @@ class App(QMainWindow):
self.statusBar().showMessage('Problem downloading %s' % url)
return None
- # add formats to combobox
+ # Search formats
if formats is None:
self.statusBar().showMessage('Formats not found')
else:
item_list = self.default_formats_menu_items[0:2]
- data_list = ['%s - %s' % (f['format_id'], f['ext']) for f in formats]
- item_list.extend(data_list)
- self.populate_video_format_combobox(item_list)
+ # ForLoop search formats
+ for quality in formats:
+ format_id = quality.get('format_id', '')
+ ext = quality.get('ext', '')
+ acodec = quality.get('acodec', '')
+ vcodec = quality.get('vcodec', '')
+ item_list.append('%s - %s (audio: %s) (video: %s)' %
+ (format_id, ext, acodec, vcodec))
+ # Replace value empty in audio or video
+ format_list = [w.replace('(audio: )', '(audio: none)')
+ .replace('(video: )', '(video: none)')
+ for w in item_list]
+ # Add formats in combobox
+ self.populate_video_format_combobox(format_list)
self.video_format_combobox.setCurrentIndex(0)
time.sleep(.300)
self.statusBar().showMessage('Finished Downloading Video Formats', msecs=0)