Protect media content on your site

Andy.N

Well-known member
I host video clips on my site and display them via embedded player (JW Player).

Is there anyway via a server script that I can disable people hotlink to the video files or embed the player on other sites. In short, the video can only be played on my site.

I run nginx, ubuntu by the way.

Thanks
 
Hmm,

Does JW player require the full url or a local path to display the content? I am guessing the local path, if so add this to your nginx config:

Code:
        location /path/to/root/of/media/library/ {
                internal;
        }

That should work.
 
Hmm,

Does JW player require the full url or a local path to display the content? I am guessing the local path, if so add this to your nginx config:

Code:
        location /path/to/root/of/media/library/ {
                internal;
        }

That should work.
Deebs
It uses local path so I can use "/video/file.mp4" to display. It doesn't take much for people to figure it out the absolute url.

I assume putting the code that you have will deny access to anyone who go to the files directly?
 
Correct.

Just replace /path/to/root/etc/etc with the absolute path to your media files you want to protect.
 
Correct.

Just replace /path/to/root/etc/etc with the absolute path to your media files you want to protect.
What about allows download if the referrer is coming from the site. For example, if users click on a link on my site, they can download it. But if the download link is posted on another forum, they can't download it.

Is it possible?
 
Can you provide urls which describe both actions? (do it via PC if you want).
Deebs,
I don't have any example up to show. Here is what i mean.

Suppose I have a video clip at www.mysite.com/video/clip1.mp4

If I post this link on my site, people clicking on it will generate a request to the server with the referrer as "www.mysite.com". The server will then return the file without problem.

Now, if some people trying to leech and put this link on another forum. Clicking on that link will generate a request to my server that is not coming from "www.mysite.com" but from another site. My server will deny this request.
 
Hmm,

Does JW player require the full url or a local path to display the content? I am guessing the local path, if so add this to your nginx config:

Code:
        location /path/to/root/of/media/library/ {
                internal;
        }

That should work.
Where do I test this?
I put
Code:
location /video/(chapter1|chapter2|chapter3|chapter4|chapter5|chapter6)/ {
     internal;
     }
in the nginx config, restart nginx. I still can go directly to the video/chapter1/video1.mp4 from the browser.
 
No, that should match on that location. Let's take it to PM, can you give me your config minus any sensitive stuff?
 
You can perhaps try to lower the default ripping, but no. You can't prevent it. One can just point a screen recorder to the media.
 
The issue is still open. Any suggestion welcome.
Thanks to Deebs who has helped a lot with many other issues on the server.
 
The issue is still open. Any suggestion welcome.
Thanks to Deebs who has helped a lot with many other issues on the server.

Deebs suggestion is the way to go in preventing hot linking. Preventing download is another issue and you cannot do it unless you host your videos in a dedicated flash / silverlight server.
 
Top Bottom