diff --git a/src/Youtube Downloader.py b/src/Youtube Downloader.py index afe800c..9c3260a 100644 --- a/src/Youtube Downloader.py +++ b/src/Youtube Downloader.py @@ -282,20 +282,37 @@ def _download_queue(self, progress_bar=None): if self.progress_bar is not None: self.progress_bar.hide() if self.queue: - self.progress_bar = progress_bar - self.progress_bar.show() - self.progress_bar.setTextVisible(True) - self.progress_bar.setFormat("Download starting...") - self.progress_bar.setValue(0) - - self.worker = Worker( - self._download_single_queue, - progress=True, - console=False, - ) - self.worker.signals.progress.connect(self._progress_bar_update) - self.worker.signals.finished.connect(self._thread_complete) - self.threadpool.start(self.worker) + if len(self.queue) > 1: + self.progress_bar = progress_bar + self.progress_bar.show() + self.progress_bar.setTextVisible(True) + self.progress_bar.setFormat("Download starting...") + self.progress_bar.setValue(0) + + self.worker = Worker( + self._download_single_queue, + progress=True, + console=False, + ) + self.worker.signals.progress.connect(self._progress_bar_update) + self.worker.signals.finished.connect(self._thread_complete) + self.threadpool.start(self.worker) + else: + self._pass_config() + self.progress_bar = progress_bar + self.progress_bar.show() + self.progress_bar.setTextVisible(True) + self.progress_bar.setFormat("Download starting...") + self.progress_bar.setValue(0) + self.worker = Worker( + self.ydl.download_video, + self.queue[0], + progress=True, + console=False + ) + self.worker.signals.progress.connect(self._progress_bar_update) + + self.threadpool.start(self.worker) else: self.bubble.setText("Queue is empty") self.bubble.show()