mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-02-14 18:04:43 +08:00
Bette exception logging when trying to download à subtitles
This commit is contained in:
parent
905c4b2798
commit
9328c4f140
1 changed files with 5 additions and 3 deletions
|
@ -22,8 +22,12 @@ def download_subtitle(path, language, hi, providers, providers_auth):
|
|||
logging.exception('Error trying to extract information from this filename: ' + path)
|
||||
return None
|
||||
else:
|
||||
best_subtitles = download_best_subtitles([video], {Language(language)}, providers=providers, hearing_impaired=hi, provider_configs=providers_auth)
|
||||
try:
|
||||
best_subtitles = download_best_subtitles([video], {Language(language)}, providers=providers, hearing_impaired=hi, provider_configs=providers_auth)
|
||||
except Exception as e:
|
||||
logging.exception('Error trying to best subtitles for this file: ' + path)
|
||||
return None
|
||||
else:
|
||||
best_subtitle = best_subtitles[video][0]
|
||||
|
||||
result = save_subtitles(video, [best_subtitle], encoding='utf-8')
|
||||
|
@ -32,8 +36,6 @@ def download_subtitle(path, language, hi, providers, providers_auth):
|
|||
message = downloaded_language + " subtitles downloaded from " + downloaded_provider + "."
|
||||
|
||||
return message
|
||||
except:
|
||||
return None
|
||||
|
||||
def series_download_subtitles(no):
|
||||
conn_db = sqlite3.connect(os.path.join(os.path.dirname(__file__), 'data/db/bazarr.db'), timeout=30)
|
||||
|
|
Loading…
Reference in a new issue