morpheus65535 / bazarr

Bazarr is a companion application to Sonarr and Radarr. It manages and downloads subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you.
https://www.bazarr.media
GNU General Public License v3.0
2.79k stars 218 forks source link

FormatAutodetectionError when doing manual download #433

Closed mehdi198080 closed 5 years ago

mehdi198080 commented 5 years ago

Couldn't convert subtitle to .srt format:

Traceback (most recent call last): 
  File "/opt/bazarr/bazarr/../libs/subliminal_patch/subtitle.py", line 242, in is_valid 
    subs = pysubs2.SSAFile.from_string(text) 
  File "/opt/bazarr/bazarr/../libs/pysubs2/ssafile.py", line 118, in from_string 
    return cls.from_file(fp, format_, fps=fps, **kwargs) 
  File "/opt/bazarr/bazarr/../libs/pysubs2/ssafile.py", line 145, in from_file 
    format_ = autodetect_format(fragment) 
  File "/opt/bazarr/bazarr/../libs/pysubs2/formats.py", line 64, in autodetect_format 
    raise FormatAutodetectionError("No suitable formats")
FormatAutodetectionError: No suitable formats
morpheus65535 commented 5 years ago

Can you provide the link to the subtitle causing this issue?

mehdi198080 commented 5 years ago

https://subscene.com/subtitles/barry-second-season/farsi_persian/1984291

morpheus65535 commented 5 years ago

@pannal Why is this exception raised when the file is clearly a valid .srt file?

pannal commented 5 years ago

I'll investigate

pannal commented 5 years ago

This should be fixed in latest bzr-dev.

Edit: FYI: The subtitle is in UTF-16 format which wasn't detected properly. Now it is.

morpheus65535 commented 5 years ago

@mehdi198080 Please test and report.

mehdi198080 commented 5 years ago

the bug fixed thank you very much