Chocobozzz / PeerTube

ActivityPub-federated video streaming platform using P2P directly in your web browser
https://joinpeertube.org/
GNU Affero General Public License v3.0
12.81k stars 1.47k forks source link

User fail to upload subtitles: This caption file is not supported or too large. #4324

Closed pullopen closed 2 years ago

pullopen commented 2 years ago

Describe the current behavior A user in my site reported that they could not upload subtitle, while I as the ruler can upload the exact same srt.

journalctl shows:

Aug 12 12:12:04 C20210731125242 peertube[6482]: [my.site:443] 2021-08-12 12:12:04.289 warn: Incorrect request parameters {
Aug 12 12:12:04 C20210731125242 peertube[6482]:   "path": "/api/v1/videos/72/captions/zh",
Aug 12 12:12:04 C20210731125242 peertube[6482]:   "err": {
Aug 12 12:12:04 C20210731125242 peertube[6482]:     "captionfile": {
Aug 12 12:12:04 C20210731125242 peertube[6482]:       "msg": "This caption file is not supported or too large. Please, make sure it is under [object Object] and one of the following mimetypes: text/vtt (.vtt), application/x-subrip (.srt), text/plain (.srt)",
Aug 12 12:12:04 C20210731125242 peertube[6482]:       "param": "captionfile",
Aug 12 12:12:04 C20210731125242 peertube[6482]:       "location": "body"
Aug 12 12:12:04 C20210731125242 peertube[6482]:     }
Aug 12 12:12:04 C20210731125242 peertube[6482]:   }
Aug 12 12:12:04 C20210731125242 peertube[6482]: }

Seems it's related to #907 , so the seemingly "PUT" request in network tab was:

multipart/form-data; boundary=----WebKitFormBoundaryxpZEe5utlKbtucQN

Also the user found this in network tab, which I could not reproduce.

f0Lq0g.png

Steps to reproduce:

  1. User upload the srt.

Describe the expected behavior

Subtitles should be successfully uploaded.

Additional information

Chocobozzz commented 2 years ago

Hello,

What is the name of the file they try to upload? What is the content of the request (I would need the body, not only the content type)? And what web browser do they use?

pullopen commented 2 years ago

Hello,

What is the name of the file they try to upload? What is the content of the request (I would need the body, not only the content type)? And what web browser do they use?

The requested content:

-----------------------------215418371960412275752149661
Content-Disposition: form-data; name="captionfile"; filename="waspcn.srt"
Content-Type: srt

1
00:00:12,274 --> 00:00:13,280
Subtitles in Simplified Chinese

-----------------------------215418371960412275752149661--

Browser: Firefox 91.0.1 (64-bit)

OS: windows 10 1909

Chocobozzz commented 2 years ago

This srt content type is really weird. Did they update OS mime types registry?

pullopen commented 2 years ago

This srt content type is really weird. Did they update OS mime types registry?

Maybe it's because this user did not update windows. Thanks anyway:)