i have a website where i run my streams for cricket matches live so lot of peoples stoles my video link and leech it to other website so my server goes down please give me the script which i can put on my page that only on my website can play that links, not even in windows media player.restrict right click and also the copying of link
the stream is in Windows Media Format
I might be able to help, can you post a sample url to a feed? I've modified an anti-leech script to pass the content through to the media player. I'm just curious if it'll do streaming stuff too.
I might be able to help, can you post a sample url to a feed? I've modified an anti-leech script to pass the content through to the media player. I'm just curious if it'll do streaming stuff too.
i have a website where i run my streams for cricket matches live so lot of peoples stoles my video link and leech it to other website so my server goes down please give me the script which i can put on my page that only on my website can play that links, not even in windows media player.restrict right click and also the copying of link
the stream is in Windows Media Format
help Plz Thanks very much.
I guess that would cost you a good amount of money since you need to hire a coding guru to get it done for you. Scripts like them may not be available free.
As we can understand, the main problem for you is not that users are able to see the direct link but the fact that users are using the direct link to download your videos. If yes, then did you try to implement the above solution?
there is nothing you can do about temporary caches, but you can "wrap" it so to speak. limit the information to something like an id.
for example. a database named profiles with a table called videos. The goal would be wrap the video and serve it from a protected source.
serve.cgi would get the information including the real url and serve that file on the page. Furthermore you could put the cgi in a frame and neatly disable things like left clicking on the form. Here's an example.
Database setup:
id (auto_increment)
name (name of the link)
destination (shortname for the video or live stream url)
Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
# use custom header (see sub header below to modify)
&header;
# Get standard input and form data.
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# Declare variables
my $vid = "$FORM{id}";
# If the id is blank kick an error.
if ($vid eq "") {
print <<EndError;
<p>Invalid video error. Click <a href="http://www.yoursite.com/">here</a> to return.
EndError
exit;
}
# Connect to the database.
$dbh = DBI->connect("dbi:mysql:profiles", "root", "password", { RaiseError => 1, AutoCommit => 1 }) or &dienice("Can't connect to database: $DBI::errstr");
# Select the information from the database.
$sth = $dbh->prepare("select * from videos where id=?") or &dbdie;
$rv = $sth->execute($vid);
$f = $sth->fetchrow_hashref;
# Define database variables.
my $vname = "$f->{name};
my $vdest = "$f->{destination};
# If the video id is invalid in the database, the subroutine &dbdie will print that error
# in a friendly way to the screen, otherwise it will continue to run the script.
## BEGIN PRINT VIDEO TO SCREEN ##
## Input your video code here. It will print to the screen and display ##
## Basically put the code to your video player and use $vdest ##
## where you would normally put the stream url ##
# For example if you're using windows media player.
print <<EndVideo;
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="$vname">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<PARAM name="autostart" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="$vdest" NAME="MediaPlayer"
WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
EndVideo
## END PRINT VIDEO TO SCREEN ##
# print custom footer (see sub footer below)
&footer;
# dbdie and dienice subroutines
sub dienice {
my($msg) = @_;
my($user, $pass, $pid);
print qq($msg\n);
exit;
}
sub dbdie {
my($package, $filename, $line) = caller;
my($errmsg) = "Database error: $DBI::errstr<br>\n called from $package
$filename line $line";
&dienice($errmsg);
}
# Page header
sub header {
print <<EndHeader;
<html>
<head>
<title></title>
<script language="JavaScript">
if (document.all) {
//IE 5.+
document.oncontextmenu =
function () {
return false;
};
document.onkeydown =
function () {
if ((window.event.keyCode == 78 && window.event.ctrlKey == true) || window.event.keyCode == 93) {
window.event.keyCode = 0;
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
};
} else if (document.layers) {
//NS 4.x
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown =
function (evt) {
if (evt.which == 3)
return false;
};
} else if (parseInt(navigator.appVersion) >= 5 && navigator.appName == "Netscape") {
//NS 6.+
document.oncontextmenu =
function () {
return false;
};
}
function chloc(x,y){
setCookie('chlocal', 'true');
temp = x + ".shtml"
if (y){
temp = temp + y
}
document.location = temp;
delCookie('chlocal');
}
function getCookie(NameOfCookie)
{
if (document.cookie.length > 0)
{
begin = document.cookie.indexOf(NameOfCookie+"=");
if (begin != -1) // Note: != means "is not equal to"
{
begin += NameOfCookie.length+1;
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); }
}
return null;
}
function setCookie(NameOfCookie, value, expiredays)
{
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) +
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}
function delCookie (NameOfCookie)
{
if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires="+ new Date();
}
}
</script>
</head>
<body>
}
sub footer {
</body>
</html>
}
That code there should work nicely. The javascript in the sub header will disable right clicking. You can add meta's for expiration and no-caching as well to stop most browsers (especially IE) from storing the generated page in the history.
What I have done in the past to prevent this from happening is to place the videos outside of the web directory (wwwroot or htdocs or public_html), and then write code to read and show the video for the user from that outside directory only if they are logged in.
I actually have the code for both PHP and ASP.NET. Let me know if either of those two would help you and I will be happy to post what I have for you.
What I have done in the past to prevent this from happening is to place the videos outside of the web directory (wwwroot or htdocs or public_html), and then write code to read and show the video for the user from that outside directory only if they are logged in.
I actually have the code for both PHP and ASP.NET. Let me know if either of those two would help you and I will be happy to post what I have for you.
I'd be interested in the PHP code, if you don't mind sharing.