From 77162c1d48f04593d43e1c8bfb9b8085ac2c0831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20V=C3=A9zina?= <5130500+morpheus65535@users.noreply.github.com> Date: Thu, 16 Nov 2017 13:30:48 -0500 Subject: [PATCH] Test --- get_subtitle.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/get_subtitle.py b/get_subtitle.py index 04fd74c97..d16101b84 100644 --- a/get_subtitle.py +++ b/get_subtitle.py @@ -13,18 +13,18 @@ region.configure('dogpile.cache.dbm', arguments={'filename': os.path.join(os.pat def download_subtitle(path, language, hi, providers): video = scan_video(path) - best_subtitles = download_best_subtitles([video], {Language(language)}, providers=providers, hearing_impaired=hi) - try: - best_subtitle = best_subtitles[video][0] - - result = save_subtitles(video, [best_subtitle]) - downloaded_provider = str(result[0]).strip('<>').split(' ')[0][:-8] - downloaded_language = pycountry.languages.lookup(str(str(result[0]).strip('<>').split(' ')[2].strip('[]'))).name - message = downloaded_language + " subtitles downloaded from " + downloaded_provider + "." - - return message - except: - return None + #best_subtitles = download_best_subtitles([video], {Language(language)}, providers=providers, hearing_impaired=hi) + #try: + # best_subtitle = best_subtitles[video][0] + # + # result = save_subtitles(video, [best_subtitle]) + # downloaded_provider = str(result[0]).strip('<>').split(' ')[0][:-8] + # downloaded_language = pycountry.languages.lookup(str(str(result[0]).strip('<>').split(' ')[2].strip('[]'))).name + # message = downloaded_language + " subtitles downloaded from " + downloaded_provider + "." + # + # return message + #except: + # return None del video del best_subtitles