mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 00:03:33 +00:00
Improved external subtitles file encoding guessing to ignore those who can't be guessed properly.
This commit is contained in:
parent
6e7858fc7c
commit
a7562e06b5
1 changed files with 2 additions and 2 deletions
|
@ -77,7 +77,7 @@ def guess_external_subtitles(dest_folder, subtitles, media_type, previously_inde
|
|||
text = f.read()
|
||||
|
||||
encoding = detect(text)
|
||||
if encoding and 'encoding' in encoding:
|
||||
if encoding and 'encoding' in encoding and encoding['encoding']:
|
||||
encoding = detect(text)['encoding']
|
||||
else:
|
||||
logging.debug("BAZARR skipping this subtitles because we can't guess the encoding. "
|
||||
|
@ -129,7 +129,7 @@ def guess_external_subtitles(dest_folder, subtitles, media_type, previously_inde
|
|||
text = f.read()
|
||||
|
||||
encoding = detect(text)
|
||||
if encoding and 'encoding' in encoding:
|
||||
if encoding and 'encoding' in encoding and encoding['encoding']:
|
||||
encoding = detect(text)['encoding']
|
||||
else:
|
||||
logging.debug("BAZARR skipping this subtitles because we can't guess the encoding. "
|
||||
|
|
Loading…
Reference in a new issue