Bug correction

pull/56/merge
morpheus65535 7 years ago
parent e8a8c2501a
commit aeda900052

@ -29,22 +29,22 @@ def download_subtitle(path, language, hi, providers, providers_auth):
return None return None
else: else:
try: try:
best_subtitle = best_subtitles[video][0] best_subtitle = best_subtitles[video][0]
except: except:
return None pass
return None
else: else:
try: try:
result = save_subtitles(video, [best_subtitle], encoding='utf-8') result = save_subtitles(video, [best_subtitle], encoding='utf-8')
except: except:
logging.error('Error saving subtitles file to disk.') logging.error('Error saving subtitles file to disk.')
return None return None
else: else:
downloaded_provider = str(result[0]).strip('<>').split(' ')[0][:-8] downloaded_provider = str(result[0]).strip('<>').split(' ')[0][:-8]
downloaded_language = pycountry.languages.lookup(str(str(result[0]).strip('<>').split(' ')[2].strip('[]'))).name downloaded_language = pycountry.languages.lookup(str(str(result[0]).strip('<>').split(' ')[2].strip('[]'))).name
message = downloaded_language + " subtitles downloaded from " + downloaded_provider + "." message = downloaded_language + " subtitles downloaded from " + downloaded_provider + "."
return message return message
def series_download_subtitles(no): def series_download_subtitles(no):
conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30) conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)

Loading…
Cancel
Save