bazarr icon indicating copy to clipboard operation
bazarr copied to clipboard

cannot download subtitle from Subs4Free

Open aka-charos opened this issue 3 years ago • 11 comments

Describe the bug There has been earlier reports about this provider -mostly in connection with finding results. However this time the problem is parsing the subtitle and processed by bazarr. The problem is evident on the log file at line 790 :

05/02/2022 16:19:08|ERROR   |subzero.modification.main       |Couldn't load subtitle: Traceback (most recent call last):  File "/opt/bazarr/bazarr/../libs/subzero/modification/main.py", line 51, in load    self.f = pysubs2.SSAFile.from_string(content)  File "/opt/bazarr/bazarr/../libs/pysubs2/ssafile.py", line 133, in from_string    return cls.from_file(fp, format_, fps=fps, **kwargs)  File "/opt/bazarr/bazarr/../libs/pysubs2/ssafile.py", line 160, in from_file    format_ = autodetect_format(fragment)  File "/opt/bazarr/bazarr/../libs/pysubs2/formats.py", line 78, in autodetect_format    raise FormatAutodetectionError("No suitable formats")pysubs2.exceptions.FormatAutodetectionError: No suitable formats|Traceback (most recent call last):  File "/opt/bazarr/bazarr/../libs/subzero/modification/main.py", line 51, in load    self.f = pysubs2.SSAFile.from_string(content)  File "/opt/bazarr/bazarr/../libs/pysubs2/ssafile.py", line 133, in from_string    return cls.from_file(fp, format_, fps=fps, **kwargs)  File "/opt/bazarr/bazarr/../libs/pysubs2/ssafile.py", line 160, in from_file    format_ = autodetect_format(fragment)  File "/opt/bazarr/bazarr/../libs/pysubs2/formats.py", line 78, in autodetect_format    raise FormatAutodetectionError("No suitable formats")pysubs2.exceptions.FormatAutodetectionError: No suitable formats|
05/02/2022 16:19:08|ERROR   |subliminal_patch.core           |Something went wrong when getting modified subtitle for <Subs4FreeSubtitle 'https://www.subs4free.info/search_report.php?search=venom let there be carnage 2021&searchType=1' [el:utf-8]>|

Can it be that the downloaded file is a zip file while bazarr expects a subtitle file format?

To Reproduce Steps to reproduce the behavior:

  • Search for subtitle in Subs4Free
  • Attempt to download the subtitle
  • subtitle is not parsed

Expected behavior subtitle downloaded , extracted from zip and processed by bazarr

Software (please complete the following information):

  • Bazarr: [v 1.0.2]
  • OS: [Ubuntu 20]

Additional context

aka-charos avatar Feb 05 '22 16:02 aka-charos

If you disable the automatic mode, does it works? This provider should handle rar and zip file properly. I've downloaded this subtitles and it looks fine to me. Not sure what's going wrong here.

morpheus65535 avatar Feb 07 '22 02:02 morpheus65535

after some troubleshooting I came to the conclusion that the problem is not with downloading but with post-processing : The only possible post-processing is "Encode Subtitles to UTF8". When any other option is checked, the subtitle is not parsed. (this affects only this provider. Any other provider for greek subs is working fine with the rest of options enabled -very strange. post-processing

aka-charos avatar Feb 07 '22 02:02 aka-charos

I jumped into false conclusions. The subtitle is not properly parsed when UTF8 is enabled . It just creates an empty srt file :(

aka-charos avatar Feb 07 '22 02:02 aka-charos

Could you provide a new debug log?

morpheus65535 avatar Feb 07 '22 03:02 morpheus65535

operation starts at line 960. I don't upload the downloaded srt as it is an empty text. bazarr.log 0

aka-charos avatar Feb 07 '22 03:02 aka-charos

Ok I've tried for the last 3 days to fix the download_subtitles function for this provider. They implemented some cloudflare protection and this cause redirect to happens with incomplete cookies that trigger another redirect to the movies page. I can't get over it and, for now, Ive lost my appetite to beat them on that. If someone else is interested to jump in and fix it, it would be nice.

morpheus65535 avatar Feb 09 '22 19:02 morpheus65535

Thanks for the help and investigation. A few things worth trying: change the domain to https://www.subs4free.club/ (.club instead of .info) give the option to provide credentials -hopefully the cloudflare protection will be less strict when logged in).

aka-charos avatar Feb 12 '22 13:02 aka-charos

changing the domain to https://www.subs4free.club/ didn't help at all. hopefully you can implement credentials (user/pass) for this provider and hope for the best :)

aka-charos avatar Feb 17 '22 10:02 aka-charos

I have a workaround locally for a different subtitle provider (zimuku). Zimuku is protected by cloudflare too. The first request returns 404 with a javascript in the response. Normal web-browser will execute it regardless of the 404 code.

This is working locally in my setup: https://github.com/sinofool/bazarr/commit/72571b1472937974c1c9c0827f05a4ec8cc292ca

I am using an external container from browserless/chrome and pyppeteer library. The HTTP requests will be executed by a real chrome browser, instead of python requests library.

This approach should be working with other providers with cloudflare protection too. It will be better to have a global configuration for all providers taking the detour.

sinofool avatar Apr 19 '22 23:04 sinofool