0

I know this is quite a basic question, but whereas i had no problem preventing image files from hotlinking, i can't figure out how i can't protect mp4 video files…

i just tried to specify mp4 next to jpg, (that's the two filetypes i need to protect), but as it works for jpg, mp4 does nothing !

Any idea ?

location ~* \.(jpg|mp4)$ {
valid_referers none blocked www.mysite.com mysite.com;
if ($invalid_referer) { return 403; }
}
Buzut
  • 765
  • 3
  • 9
  • 23

1 Answers1

1

Unfortunately whatever method you use to "protect" the progressive download, it can still be thwarted.

This problem is, that videos are specified as streaming contents.

Actually, many video-downloader tools are so powerful, so it is very difficult to protect the video files from being downloaded.

Usually, there is a three step solution:

  1. GET /path/to/file - return an HTML form with a capcha or some other method to avoid automa
  2. POST /path/to/file - return an HTTP redirect using a secure hash
  3. GET /path/to/file?hash=xxx - check the hash

You can perfect this method by implementing the H264 Streaming Module for nginx.

mate64
  • 1,641
  • 4
  • 18
  • 29
  • thank you very much for your answer, i'll have a look at the streaming module. Anyway, i don't realy want to protect the videos from downloading, i just don't want another website to embed the video on its own pages. Another solution anyway, could be to program a system with dynamically generated URLs so that it's not possible to copy it for further usage… – Buzut Dec 14 '12 at 17:15