From 7f2d2e5ce896894937f72d26eb14c00d0d2f2b49 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Mon, 20 May 2019 10:49:23 -0400 Subject: [PATCH] Fix was needed to remove the -dl option. Dunno why, but now it works. --- DemoPrograms/Demo_Youtube-dl_Frontend.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/DemoPrograms/Demo_Youtube-dl_Frontend.py b/DemoPrograms/Demo_Youtube-dl_Frontend.py index adddc682..18363f85 100644 --- a/DemoPrograms/Demo_Youtube-dl_Frontend.py +++ b/DemoPrograms/Demo_Youtube-dl_Frontend.py @@ -37,21 +37,21 @@ def DownloadSubtitlesGUI(): if event == 'Get List': print('Getting list of subtitles....') window.Refresh() - command = [f'C:/Python/PycharmProjects/GooeyGUI/youtube-dl --list-subs {link}',] + command = [f'C:\\Python\\Anaconda3\\Scripts\\youtube-dl.exe --list-subs {link}',] output = ExecuteCommandSubprocess(command, wait=True, quiet=True) lang_list = [o[:5].rstrip() for o in output.split('\n') if 'vtt' in o] lang_list = sorted(lang_list) combobox.Update(values=lang_list) print('Done') - elif event is 'Download': + elif event == 'Download': lang = values['lang'] if lang is '': lang = 'en' print(f'Downloading subtitle for {lang}...') window.Refresh() - command = (f'C:/Python/PycharmProjects/GooeyGUI/youtube-dl --sub-lang {lang} --write-sub {link}',) - ExecuteCommandSubprocess(command, wait=True) + command = [f'C:\\Python\\Anaconda3\\Scripts\\youtube-dl.exe --sub-lang {lang} --write-sub {link}',] + print(ExecuteCommandSubprocess(command, wait=True, quiet=False)) print('Done') @@ -65,7 +65,9 @@ def ExecuteCommandSubprocess(command, wait=False, quiet=True, *args): print(out.decode("utf-8")) if err: print(err.decode("utf-8")) - except: return '' + except Exception as e: + print('Exception encountered running command ', e) + return '' return (out.decode('utf-8'))