Fix was needed to remove the -dl option. Dunno why, but now it works.

This commit is contained in:
MikeTheWatchGuy 2019-05-20 10:49:23 -04:00
parent b9de069343
commit 7f2d2e5ce8
1 changed files with 7 additions and 5 deletions

View File

@ -37,21 +37,21 @@ def DownloadSubtitlesGUI():
if event == 'Get List': if event == 'Get List':
print('Getting list of subtitles....') print('Getting list of subtitles....')
window.Refresh() 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) output = ExecuteCommandSubprocess(command, wait=True, quiet=True)
lang_list = [o[:5].rstrip() for o in output.split('\n') if 'vtt' in o] lang_list = [o[:5].rstrip() for o in output.split('\n') if 'vtt' in o]
lang_list = sorted(lang_list) lang_list = sorted(lang_list)
combobox.Update(values=lang_list) combobox.Update(values=lang_list)
print('Done') print('Done')
elif event is 'Download': elif event == 'Download':
lang = values['lang'] lang = values['lang']
if lang is '': if lang is '':
lang = 'en' lang = 'en'
print(f'Downloading subtitle for {lang}...') print(f'Downloading subtitle for {lang}...')
window.Refresh() window.Refresh()
command = (f'C:/Python/PycharmProjects/GooeyGUI/youtube-dl --sub-lang {lang} --write-sub {link}',) command = [f'C:\\Python\\Anaconda3\\Scripts\\youtube-dl.exe --sub-lang {lang} --write-sub {link}',]
ExecuteCommandSubprocess(command, wait=True) print(ExecuteCommandSubprocess(command, wait=True, quiet=False))
print('Done') print('Done')
@ -65,7 +65,9 @@ def ExecuteCommandSubprocess(command, wait=False, quiet=True, *args):
print(out.decode("utf-8")) print(out.decode("utf-8"))
if err: if err:
print(err.decode("utf-8")) print(err.decode("utf-8"))
except: return '' except Exception as e:
print('Exception encountered running command ', e)
return ''
return (out.decode('utf-8')) return (out.decode('utf-8'))