generate headers for webm file to play downloaded corrupted media

there is a website that fetches some .webm files from their server, some are what appears to be chunks of the file, the more it plays, others appear to be some form of the complete webm file.

However, when attempting to play any of these files in a custom video element or any other vide player, it is either just black, or white, or doesn't play.

I think it has to do with incomplete headers

I suspect that the host website downloads some kind of chunk of the video from the server, then somehow appends the webm headers separately in order play it in their own player

The thing is, I want to be able to play (and eventually download) a fully operational .webm file, based on the other corrupted webm files, and I suspect the way to do this is to write some custom .webm headers and append them to the beginning of the video, and this is where I need some help.

I'm aware there is the WebM Specification, I just don't know how to use it with client-side JavaScript to accomplish what I need here, or if this is even the right kind of solution, because I've also heard of the MediaSource API, which I also suspect is used for this (website is here)

Upvotes: 1

Views: 1218

Answers (1)

Henrique Lima
Henrique Lima

Reputation: 121

You do not need to obtain each part of the webm files. Just adjust the interval parameter, at the end of the request, and download the complete file.

For example:
https://r1---sn-b8u-nn5l.googlevideo.com/videoplayback?...&range=0-76746&...
...&range=76746-183717&...
...&range=398277-751324&...
...&range=751325-1387287&...

You just need change the start and final range to get the part you wish
...&range=0-1387287&...

Upvotes: 0

Related Questions