Skip to content

Instantly share code, notes, and snippets.

@fengxx
Created October 2, 2012 11:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fengxx/3818292 to your computer and use it in GitHub Desktop.
Save fengxx/3818292 to your computer and use it in GitHub Desktop.
simplfy rayfile download
//author fengxx
var downloadLinkOK=false
var redirectOk=false
if (location.href.indexOf('www.rayfile.com/zh-cn/files/')!=-1 )
{
function redirectme(userJSEvent){
if(typeof vid !="undefined" && typeof vkey !="undefined" && !redirectOk){
redirectOk=true
var nextUrl="http://www.rayfile.com/zh-cn/files/"
+vid+"/"+vkey+"/";
if(nextUrl!=location.href){
location.href=nextUrl
}
}
}
function showfs2you(e){
if(downloadLinkOK){
window.close()
}
//check if contains fs2you
if(typeof vod_urls !="undefined" && !downloadLinkOK){
downloadLinkOK=true
downLoadUrl=vod_urls[0]
window.location=downLoadUrl
}
}
window.opera.addEventListener('AfterScript',
redirectme,false)
window.opera.addEventListener('BeforeScript',
showfs2you,false)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment