PDA

View Full Version : Stoping people from leaching videos


jfrovich
31-08-2006, 23:28/11:28PM
off my site..
Well my brothers site.

I have his domain hosting on my ip
and he has a wp blog with some content and video's but people are leaching the video's and the bandwidth is killing me
im going to have to upgrade my hosting account..
now my brother is on social assistance, as he has a few disabilities , so im helping him out as he cant pay for hosting with this much bandwidth requirements
How do I stop the leaching?

WebSavvy
31-08-2006, 23:43/11:43PM
What's the file extension on the videos? Just tell me this, give me 5 minutes and I'll write you a php script that will stop it. You'll need to recode just the video url only in his pages, but it will work. :)

I'll PM it to you here.

radiotv
31-08-2006, 23:56/11:56PM
Isn't there a way to do this globally (sitewide) through .htaccess?

WebSavvy
01-09-2006, 00:05/12:05AM
If he has CPanel, he can use Leech Guard (it's a CPanel feature).

jfrovich
01-09-2006, 00:17/12:17AM
Hi Savvy1
thier all .wmv files

and i have used Leech Guard
but im not sure i fully understand it
and its called
Hotlink protection

HotLink Protection Enabled!

Allowed Referers:

all my sites & subdomains

Protected Extensions: jpg,jpeg,gif,png,bmp

guess i need to add a few more to this ext list?
and i believe the hotlink protection is working.
if i click on the link in my weblogs it redirects to the page i chose.

its that all i need to do

radiotv
01-09-2006, 00:27/12:27AM
Deb, it looks like you have another way of doing this other than .htaccess, so I guess I’m just curious about the differences and/or advantages in the different methods of preventing hotlinking. Just to clarify, I’m certainly not questioning your method by any means (you’re becoming one of my “coding heroes”). Just wondering for my personal educational purposes. Thanks.

WebSavvy
01-09-2006, 02:30/02:30AM
Yeah, Jason -- that should do it.

radio, yes there's another way to do it using PHP.

If you have images located in an image folder, let's say at:

/images/

This can be defined in a file we'll call img.php

Then, each image extension is given a number as the file type.

Example:

.gif = 1
.png = 2
.jpg = 3
.avi = 4
.swf = 5

You can add any type of image extension to this and it will work.

Then, in the img src put it as:

<img src="/img.php?fi=filename&type=2" height="xx" width="xx" alt="ALT TEXT">

filename would be replaced with the name of your file (like avatar.png would be:

/img.php?fi=avatar&type=2

Your images folder location is never disclosed.

People cannot hotlink to the script to get images either.

:D

radiotv
01-09-2006, 03:25/03:25AM
Very cool. Thanks for sharing.