From dc34c438ce3b9984b92a93e8a57c18eedefc5d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sun, 15 Dec 2019 21:35:18 -0500 Subject: fix list empty formats --- hypervideo_gui/main_ui.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'hypervideo_gui/main_ui.py') diff --git a/hypervideo_gui/main_ui.py b/hypervideo_gui/main_ui.py index 355a710..653e0de 100644 --- a/hypervideo_gui/main_ui.py +++ b/hypervideo_gui/main_ui.py @@ -349,9 +349,13 @@ class MainWindow(QMainWindow): out = out.partition("resolution note")[2] out = out.partition('\n')[2] mylist = out.rsplit('\n') - self.video_format_combobox.addItems(mylist) - count = self.video_format_combobox.count() - self.video_format_combobox.setCurrentIndex(count-1) + debugging('Formats process finished with list: %s' % mylist) + if mylist != ['']: + self.video_format_combobox.addItems(mylist) + count = self.video_format_combobox.count() + self.video_format_combobox.setCurrentIndex(count-1) + else: + self.show_message("Formats empty") def download_selected(self): ''' Download selected video format ''' -- cgit v1.2.3