Bug correction

This commit is contained in:
morpheus65535 2018-01-05 10:41:08 -05:00
parent e8a8c2501a
commit aeda900052
1 changed files with 15 additions and 15 deletions

View File

@ -29,22 +29,22 @@ def download_subtitle(path, language, hi, providers, providers_auth):
return None
else:
try:
best_subtitle = best_subtitles[video][0]
except:
return None
best_subtitle = best_subtitles[video][0]
except:
pass
return None
else:
try:
result = save_subtitles(video, [best_subtitle], encoding='utf-8')
except:
logging.error('Error saving subtitles file to disk.')
return None
else:
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
try:
result = save_subtitles(video, [best_subtitle], encoding='utf-8')
except:
logging.error('Error saving subtitles file to disk.')
return None
else:
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
def series_download_subtitles(no):
conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)