View Single Post
Old 03-10-2005, 13:18   #4
punky
Eric Cartman Wannabe
 
punky's Avatar
 
Join Date: Jun 2003
Location: Cockney geeza land
Age: 27
Services: c:\> net start punky
Posts: 12,135
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
punky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver blingpunky has a lot of silver bling
Re: Hotlinking Video Files... (How to STOP It)

Do you know much PHP?

You should be able to use PHP as a download wrapper, to mask the true file's path.

You'd have a link like:

www.suziperry.tv/vid/downloadvid.php?id=12

And the PHP would be like:

PHP Code:
<?php

if (isset($_GET['id']))
{

    if(
$_SERVER['HTTP_REFERER'] == 'http://www.suziperry.tv/vid/vids.php')
    {
    
header"Location: http://www.suziperry.tv/secret.path.to.vids/" $_GET['id'] );
    }
    else
    {
    echo 
"Hotlinking is banned.";
    }

     
else
{
echo 
"Missing id number.";
}

?>
That should work, although I haven't tried it. If I get time later, I might test it out.

That's the simplest wrapper, but has a flaw. If people find out your secret path (a browser might display it), then they can still leech your site. The way to get around this is to have an array of filenames, so that people can't guess the names.

i.e. $filenames = array('suzieating.avi, 'suzidrinking.mpg'...) so 0 = her eating, 1 equals her drinking. PHP is server-side code, so users can't find out your array of filenames.

HTH.
__________________
"We're not here for a long time, we're here for a good time" - Mike Ness (Social Distortion)
"Reach for the sky, 'cause tomorrow may never come" - Reach For The Sky (Social Distortion)
punky is online now   Reply With Quote