Skip to content

Instantly share code, notes, and snippets.

@efonte
Forked from colt365/Bilibili 收藏夹备份.user.js
Created July 20, 2014 10:45
Show Gist options
  • Save efonte/d30f9865ace68919919d to your computer and use it in GitHub Desktop.
Save efonte/d30f9865ace68919919d to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Redirector
// @namespace http://userscripts.org/users/colt365
// @description Redirect on some sites
// @include http://share-links.biz/*
// @include http://*yufan520.com/*
// @include http://*yunfile.com/*
// @include http://9ez.me/*
// @include http://article.woshao.com/*
// @include http://*.rapeit.net*
// @include http://bc.vc/*
// @include http://sh.st/*
// @include http://rdlnk.co/*
// @include http://*.linkbucks.com/*
// @include http://adf.ly/*
// @include http://shr77.com/*
// @include http://www.kingfiles.net/*
// @include http://www.tusfiles.net/*
// @include http://media4.us/*
// @version 20140306
// ==/UserScript==
a = location.hostname.split('.')[0];
b = location.hostname.split('.')[1];
if ("share-links$9ez$yunfile$bc$sh$rdlnk$adf$shr77$media4$".indexOf(a) >= 0) {
eval('_' + a.replace(/-/, '') + '()');
} else if ("yufan520$yunfile$woshao$rapeit$linkbucks$kingfiles$tusfiles$".indexOf(b) >= 0) {
eval('_' + b.replace(/-/, '') + '()');
} else {
// alert(location.hostname); // for debug
}
function reloadPage() {
location.reload();
}
function setCookie(sName,sValue) {
document.cookie = sName + "=" + escape(sValue);
}
function getCookie(sName) {
var aCookie = document.cookie.split(";");
for(var i=0; i < aCookie.length; i++) {
var aCrumb = aCookie[i].split("=");
if(sName == trim(aCrumb[0])) {
return trim(unescape(aCrumb[1]));
}
}
return null;
}
function trim(str) {
while (str.charAt(0) == ' ') {
str = str.substr(1);
}
while (str.charAt(str.length - 1) == ' ') {
str = str.substr(0, str.length - 1);
}
return str;
}
function framekiller() {
if (window.top!=window.self) window.top.location=location;
}
function _yufan520() {
var allLink = document.getElementsByTagName("a");
for (i = allLink.length - 1; i >= 0; --i) {
if (allLink[i].innerHTML.search(/download/i) >= 0) {
location.assign(allLink[i].href);
}
}
}
function _sharelinks(){
var query = location.toString().split('/')[3];
if(query.charAt(0) == '_') {
if (document.getElementsByClassName('decrypt').length != 0) {
// redirect after input captcha
location.assign("http://"+unsafeWindow.basewebclean+"/get/lnk/" + document.getElementsByClassName('decrypt')[0].getElementsByTagName("img")[0].onclick.toString().split("'")[1]);
} else {
// reload the captcha page if it's not last opened
setCookie("lastOpen", query.substr(1));
unsafeWindow.onfocus = function(){if(getCookie("lastOpen")!=query.substr(1)){document.getElementById("captcha_container").style.visibility="hidden"; reloadPage();}};
}
} else if(location.toString().split('/')[4] == 'frm') {
if(document.getElementsByTagName('p')[0].innerHTML.search(/fatal/i) != -1) {
setTimeout("history.back();", 5000);
}
}
}
function _9ez(){
document.getElementById("btnSubmit").onclick();
}
function _yunfile(){
if (location.toString().split('/')[4] == 'down') {
// to download
unsafeWindow.ck();
document.getElementById('hidebtn').click();
} else {
// to redirect // fail now because of captcha
// unsafeWindow.redirectDownPage();
// document.getElementById('slow_button').click();
// document.getElementById('wait_span').innerHTML = '0';
}
}
function _woshao() {
var url = document.getElementById('LinkSource').href;
location.assign('http://' + url.split('http://')[2]);
}
function _rapeit() {
document.getElementById('download_link').click();
}
function _bc() {
setTimeout("location.assign('http' + location.href.split('http')[2]);",5000);
}
function _sh() {
setInterval("document.getElementById('skip_button').click();",8000);
}
function _rdlnk() {
setTimeout("location.assign(location.href.split('?rdu=')[1]);",6000);
}
function _linkbucks() {
setInterval("document.getElementById('skiplink').click();",3000);
}
function _adf() {
if (location.href.indexOf('adf.ly/ad/locked') >= 0) {
setInterval("document.getElementById('continue').childNodes[1].childNodes[1].click();", 5000);
return;
}
setTimeout("document.getElementById('skip_button').click();",9000);
}
function _shr77() {
setInterval("document.getElementById('loading').click();",4000);
}
function _kingfiles() {framekiller();}
function _tusfiles() {framekiller();}
function _media4() {
document.getElementById('download_link').click();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment