Skip to content

Commit

Permalink
Improved external subtitles file encoding guessing to ignore those wh…
Browse files Browse the repository at this point in the history
…o can't be guessed properly.
  • Loading branch information
morpheus65535 committed Jul 22, 2023
1 parent 6e7858f commit a7562e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bazarr/subtitles/indexer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down Expand Up @@ -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. "
Expand Down

0 comments on commit a7562e0

Please sign in to comment.