View Single Post
Old 03-10-2005, 14:18   #4
punky
Inactive
 
Join Date: Jun 2003
Age: 45
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
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.
punky is offline   Reply With Quote