About preventing file download hotlinking use JS to prevent file address hotlinking (ii)

Source: Internet
Author: User
Tags key
js| Download

Music.htm
-----------------
<title>PlayMusic</title>
<script Language=jscript src=play_url.js></script>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "><body bgcolor= "#999999" >
<table cellspacing=0 cellpadding=0 width=468 align=center border=0>
<!--dwlayouttable-->
<TBODY>
<TR>
&LT;TD width= "468" height=60 align=middle valign= "Top" ><font "2" > You are now listening to: size= </font><font " #FF0000 "size=2>
<script language= "JavaScript" >
if (wor==undefined)
{
document.write ("No Tracks")
}
Else
document.write (WOR)
</script>
</font></TD>
</TR>
</TBODY>
</TABLE>
<table height=60 cellspacing=0 cellpadding=0 width=468 align=center
<TBODY>
<TR>
&LT;TD class=box bgcolor= #eeeeee height=60 align= "center" >
<div align= "center" >
<script language= "javascript" src= "Mp.js" ></script>
</div>
</TD>
</TR>
</TBODY>
</TABLE>
<div align= "center" >
</body>
There is a section of code that introduces two JS Play_url.js,mp.js here is the key. Let's take a look at this code next.
-------------------------------------------------------------------------------------------
****************************************************************************
Mp.jps
---------------------------------
document.write ("<object id=player2 name=player classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 border=\" width=100% height=68 type=application/x-oleobject standby=\ "Loading Windows Media Player components...\" >\n ")
document.write ("<param name=\" audiostream\ "value=\" -1\ ">\n")
document.write ("<param name=\" autosize\ "value=\" 0\ ">\n")
document.write ("<param name=\" autostart\ "value=\" -1\ ">\n")
document.write ("<param name=\" animationatstart\ "value=\" -1\ ">\n")
document.write ("<param name=\" allowscan\ "value=\" -1\ ">\n")
document.write ("<param name=\" allowchangedisplaysize\ "value=\" -1\ ">\n")
document.write ("<param name=\" autorewind\ "value=\" 0\ ">\n")
document.write ("<param name=\" balance\ "value=\" 10\ ">\n")
document.write ("<param name=\" baseurl\ "value>\n")
document.write ("<param name=\" bufferingtime\ "value=\" 5\ ">\n")
document.write ("<param name=\" captioningid\ "value>\n")
document.write ("<param name=\" clicktoplay\ "value=\" -1\ ">\n")
document.write ("<param name=\" cursortype\ "value=\" 0\ ">\n")
document.write ("<param name=\" currentposition\ "value=\" -1\ ">\n")
document.write ("<param name=\" Currentmarker\ "value=\" 0\ ">\n")
document.write ("<param name=\" defaultframe\ "value>\n")
document.write ("<param name=\" displaybackcolor\ "value=\" 0\ ">\n")
document.write ("<param name=\" displayforecolor\ "value=\" 16777215\ ">\n")
document.write ("<param name=\" displaymode\ "value=\" 0\ ">\n")
document.write ("<param name=\" displaysize\ "value=\" 4\ ">\n")
document.write ("<param name=\" enabled\ "value=\" -1\ ">\n")
document.write ("<param name=\" enablecontextmenu\ "value=\" 0\ ">\n")
document.write ("<param name=\" Enablepositioncontrols\ "value=\" -1\ ">\n")
document.write ("<param name=\" Enablefullscreencontrols\ "value=\" 0\ ">\n")
document.write ("<param name=\" Enabletracker\ "value=\" -1\ ">\n")
document.write ("<param name=\" filename\ "value=" "+ str +" ' >\n ")
document.write ("<param name=\" Invokeurls\ "value=\" -1\ ">\n")
document.write ("<param name=\" language\ "value=\" -1\ ">\n")
document.write ("<param name=\" mute\ "value=\" 0\ ">\n")
document.write ("<param name=\" playcount\ "value=\" 0\ ">\n")
document.write ("<param name=\" previewmode\ "value=\" 0\ ">\n")
document.write ("<param name=\" rate\ "value=\" 1\ ">\n")
document.write ("<param name=\" samilang\ "value>\n")
document.write ("<param name=\" samistyle\ "value>\n")
document.write ("<param name=\" samifilename\ "value>\n")
document.write ("<param name=\" selectionstart\ "value=\" 0\ ">\n")
document.write ("<param name=\" selectionend\ "value=\" 0\ ">\n")
document.write ("<param name=\" sendopenstatechangeevents\ "value=\" -1\ ">\n")
document.write ("<param name=\" sendwarningevents\ "value=\" -1\ ">\n")
document.write ("<param name=\" senderrorevents\ "value=\" -1\ ">\n")
document.write ("<param name=\" sendkeyboardevents\ "value=\" 0\ ">\n")
document.write ("<param name=\" sendmouseclickevents\ "value=\" 0\ ">\n")
document.write ("<param name=\" sendmousemoveevents\ "value=\" 0\ ">\n")
document.write ("<param name=\" sendplaystatechangeevents\ "value=\" -1\ ">\n")
document.write ("<param name=\" showcaptioning\ "value=\" 0\ ">\n")
document.write ("<param name=\" Showcontrols\ "value=\" -1\ ">\n")
document.write ("<param name=\" Showaudiocontrols\ "value=\" -1\ ">\n")
document.write ("<param name=\" showdisplay\ "value=\" 0\ ">\n")
document.write ("<param name=\" showgotobar\ "value=\" 0\ ">\n")
document.write ("<param name=\" Showpositioncontrols\ "value=\" -1\ ">\n")
document.write ("<param name=\" showstatusbar\ "value=\" -1\ ">\n")
document.write ("<param name=\" Showtracker\ "value=\" -1\ ">\n")
document.write ("<param name=\" transparentatstart\ "value=\" 0\ ">\n")
document.write ("<param name=\" videoborderwidth\ "value=\" 0\ ">\n")
document.write ("<param name=\" videobordercolor\ "value=\" 0\ ">\n")
document.write ("<param name=\" videoborder3d\ "value=\" 0\ ">\n")
document.write ("<param name=\" volume\ "value=\" 0\ ">\n")
document.write ("<param name=\" windowlessvideo\ "value=\" 0\ ">\n")
document.write ("<embed type=\" application/x-mplayer2\ "pluginspage=\" http://www.microsoft.com/windows/ Mediaplayer/download/default.asp\ "name=\" Player\ "width=\" 300\ "height=\" 66\ "border=\" 0\ "SHOWSTATUSBAR=\" -1\ " Showcontrols=\ "0\" showgotobar=\ "0\" showdisplay=\ " -1\" invokeurls=\ " -1\" autostart=\ "1\" CLICKTOPLAY=\ "0\" Displayforecolor=\ "12945678\" >\n ")
document.write ("</object>\n")

----------------------------------------------
************************************
Play_url.js
----------------------
<script language= "JavaScript" type= "Text/javascript"
var searchstring=location.search          //<--------- Remove the passed arguments
Var pos=searchstring.indexof ("Url=")              
if (pos==0) {


  var str,str1,arr,wor;
  Arr=searchstring.split (' & ');                    //<----------to separate the address from the name of the song
  if (Arr.length > 1) {
     Wor=arr[1];
 }
  else{
   wor= "";
 }
//The following section is the key here, and the string is decoded here, understand?
Str=arr[0].substr (5,searchstring.length);
Str=str.replace (/yvi/g, "1")
Str=str.replace (/esr/g, "2")
Str=str.replace (/sxn/g, "3")
Str= Str.replace (/sti/g, "4")
Str=str.replace (/wfu/g, "5")
Str=str.replace (/lqu/g, "6")
Str=str.replace (/qgi/ G, "7")
Str=str.replace (/bla/g, "8")
Str=str.replace (/jfu/g, "9")
Str=str.replace (/lsn/g, "0")
str= Str.replace (/xpg/g, "/")
Str=str.replace (/xqd/g, ".")
Str=str.replace (//g, "")
Str=str.replace (/%20/g, "")
Str=str.replace (/kwd/g, "MP3")
str= "127.0.0.1//" musicmp3/"+ str
document.write (str)
}
</script>


------------------------------------------------------------------------
********************************
About preventing file download hotlinking use JS to prevent file address hotlinking (i) http://blog.csdn.net/bluedestiny/archive/2004/09/23/114104.aspx
-----------------------------------------------------



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.