Author |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Wed 02 Aug '06 2:47 Post subject: Hotlinking Protection for Video Files?? |
|
|
Hi,
I've saw numerous articles, and modules for apache that helps protect websites from hotlinking protection, but none of them work for windows. Can anyone tell me any modules, or programs that would help prevent hotlinking protection for video files.
I'm interested in something that changes the link transparently, and would work for apache on windows. Thanks |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Wed 02 Aug '06 10:30 Post subject: |
|
|
Please tell what you tried. When it works on *nix it should work on windows. |
|
Back to top |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Wed 02 Aug '06 10:34 Post subject: |
|
|
admin wrote: | Please tell what you tried. When it works on *nix it should work on windows. |
http://www.modhotlink.com/ |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3093 Location: Hilversum, NL, EU
|
Posted: Wed 02 Aug '06 10:55 Post subject: |
|
|
That is a binary for Linux.
I see no source on that site for 2.2, so we cannot try to build it for Windows.
Best to contact the author.
Steffen |
|
Back to top |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Wed 02 Aug '06 11:18 Post subject: |
|
|
Well can you recommend something for windows?? I need to prevent my video files from being hotlinked. Is there any software on the market that works for apache on windows? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 02 Aug '06 12:11 Post subject: |
|
|
I would programm in php a redirect link or a capture picture for myself. |
|
Back to top |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Wed 02 Aug '06 12:17 Post subject: |
|
|
How do I do this?? |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 02 Aug '06 13:08 Post subject: |
|
|
this is a snippet not a final code!!!
yourpage.php
Code: |
session_name('anti_hotdownload');
session_start();
if($_POST['do']==1&&$_SESSION['image'] == $_POST['code']){
echo '<a href="yourlink'>download</a>';
}
else
{
echo <<<END
<form action="yourpage.php" method="post">
<input type="hidden" name="do" value="1" />
<input type="text" name="code" /><img src="img.php" border="0" height="20" width="60" /><br />
<input type="submit" value="{$_lang['ok']}" />
</form>
END;
}
|
img.php
Code: |
<?php
/**
* @author: James Blond, James Blond
*
* @param String $strSessionVar
* @param Array $rgBgColor
* @param Array $rgTextColor
* @param int $x
* @param int $y
* @return Image
*/
function security($strSessionVar,$rgBgColor,$rgTextColor,$x,$y){
mt_srand((double)microtime()*1000000); //Zufallszahl
$iRandVal = mt_rand(100000,999999);
$_SESSION[$strSessionVar] = $iRandVal;
$im = imagecreate($x,$y) or die("GD-stream konnte nicht gestartet werden");
$background_color = imagecolorallocate($im, $rgBgColor[0],
$rgBgColor[1],
$rgBgColor[2]);
$text_color = imagecolorallocate($im, $rgTextColor[0],
$rgTextColor[1],
$rgTextColor[2]);
imagestring($im,5,0,0,$iRandVal,$text_color);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im); }
session_name('anti_hotdownload');
session_start();
security('image',array(255,255,0),array(0,0,0),60,20);
?>
|
i hope you know a bit of PHP.... |
|
Back to top |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Thu 03 Aug '06 11:50 Post subject: |
|
|
Unfortunately I do not know PHP. I have a site that runs on PHP-NUKE, and I know how to go in and make small changes... but I dont know how to implement the above file. Can you please help me... people are stealing the movies directly off of my server and hotlinking them. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3093 Location: Hilversum, NL, EU
|
Posted: Thu 03 Aug '06 12:44 Post subject: |
|
|
unmgroup wrote: | Unfortunately I do not know PHP. I have a site that runs on PHP-NUKE, and I know how to go in and make small changes... but I dont know how to implement the above file. Can you please help me... people are stealing the movies directly off of my server and hotlinking them. |
To be fullproof is the best to let download only logged-in users or use a script like that one from james.
On the server side only you can do, is using mod_rewrite, see http://www.apachelounge.com/viewtopic.php?t=19
Steffen |
|
Back to top |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Thu 03 Aug '06 23:21 Post subject: |
|
|
Yes, I have something like this in place for images. I need a solution for video protection. |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3093 Location: Hilversum, NL, EU
|
Posted: Thu 03 Aug '06 23:32 Post subject: |
|
|
And when you change in the rewrite rule the extensions gif|jpg|png to your video file extension(s) ?
Steffen |
|
Back to top |
|
unmgroup
Joined: 22 Jul 2006 Posts: 19
|
Posted: Fri 04 Aug '06 1:54 Post subject: |
|
|
Steffen wrote: | And when you change in the rewrite rule the extensions gif|jpg|png to your video file extension(s) ?
Steffen |
That doesnt work for video files, because the referer information is not sent. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
Posted: Wed 27 Dec '06 13:18 Post subject: |
|
|
Code: |
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://yourdomain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.yourdomain.com.*$ [NC]
RewriteRule .*\.(gif|jpg|jpeg|bmp)$ http://www.yourdomain.com/stophotlinking.html [R,NC]
|
|
|
Back to top |
|