Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot download subtitle from Subs4Free #1710

Open
aka-charos opened this issue Feb 5, 2022 · 9 comments
Open

cannot download subtitle from Subs4Free #1710

aka-charos opened this issue Feb 5, 2022 · 9 comments

Comments

@aka-charos
Copy link

aka-charos commented Feb 5, 2022

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

@morpheus65535
Copy link
Owner

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.

@aka-charos
Copy link
Author

aka-charos commented Feb 7, 2022

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
Copy link
Author

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

@morpheus65535
Copy link
Owner

Could you provide a new debug log?

@aka-charos
Copy link
Author

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

@morpheus65535
Copy link
Owner

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.

@aka-charos
Copy link
Author

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
Copy link
Author

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 :)

@sinofool
Copy link

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:
sinofool@72571b1

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants