-
Notifications
You must be signed in to change notification settings - Fork 226
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
Can't download subtitles due to "413 Request Entity Too Large" #660
Comments
Can you confirm you still have this issue with 0.8.3? |
Yes, I've just upgraded and the behaviour is the same. I'm attaching the response from
|
Oh, actually here's a minimal reproduction with
When |
I can increase the max_request_body_size which is by default at 100Mb but I don't get why you have subtitles pickled object that large... Does it happen only with NapiProjekt? |
I've just test a polish subtitles from NapiProjekt and the pickled subtitles object is "only" 59Kb... |
I was looking into the issue as well and it turns out that the default limit is 100 kB (not 100 MB). Other subtitles (OpenSubtitles, Napiprojekt) worked before, so there must be something fishy about that particular one. I can debug it further if you guide me a bit more as I don't know this project too well :)
|
What is the value of Line 403 in c442524
|
@morpheus65535 After further debugging it turns out to be an encoding issue. Downloaded subtitles are apparently UTF16LE (with BOM), which is pretty uncommon for Polish-oriented encodings. Probably someone made a mistake when uploading the file to NapiProjekt. The thing is - if you try to open the file ( I've looked into the code and it looks like Bazaar tries to guess the encoding all be itself. It's a tricky business, sometimes almost impossible to guess correctly. Did you consider switching to dedicated libraries like chardet or python-magic? Or does the encoding guessing generally work good enough for users? |
Thanks for the time you put in debugging that issue. In fact, we rely on subliminal_patch module that come from Subzero and it's the one guessing the encoding. If it fails, it fallback to chardet. Looks like he didn't get that it was failing on that one... :-/ @pannal could it be possible to add bazarr/libs/subliminal_patch/subtitle.py Line 152 in bed9883
|
It does. I'm wondering whether adding UTF16-LE to It's bad that windows-1250 decodes without an exception. Can you try downloading a subtitle with true windows-1250/iso-8859-2 and decode it using UTF16-LE and see whether that fails? |
This might be fixed in the development branch. Please check! |
Describe the bug
When manually downloading subtitles I noticed that whenever I pick a subtitle, the page refreshes, but the subtitles are not applied.
I can upload the subtitles manually and that works fine.
Technical background: endpoint "manual_get_subtitle" returns error "413 Request Entity Too Large" so I assume that the uplaoded base64 is too large.
Is there any option to configure max body size? Not sure if it's CherryPy or Bottle that needs the change.
The subtitles file that causes problems is that one: http://napiprojekt.pl/unit_napisy/dl.php?nick=&f=6d2d743a7e27564e25f4fc6b09c29109&kolejka=false&t=84b05&napios=Linux&v=dreambox&pass=&l=PL (filename
6d2d743a7e27564e25f4fc6b09c29109
).To Reproduce
Steps to reproduce the behavior:
Expected behavior
The subtitles are downloaded and stored on disk.
Screenshots
Software (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: