// added to obsolete daj.to, dataport.cz, ddlstorage.com, dizzcloud.com // ==UserScript== // @name W.A.R. Links Checker Customized Premium Link Version // @description detects live, dead and premium links. // @details this script automatically checks links from 650+ filehosts. For Firefox, Chrome, Opera, Safari. // @namespace premium version // @version 1.1.5.9 // @icon http://sharenxs.com/photos/2014/02/14/52fd759db90ac/cooltext1428903746.png // @license GPL version 3 or any later version (http://www.gnu.org/copyleft/gpl.html) // @author Censored link."); $(span).html(censoredLink); span.addEventListener("mouseover", displayTooltipError, false); cLinksTotal++; cLinksProcessed++; cLinksDead++; textNode.parentNode.replaceChild(span, textNode); continue; alert(censoredLink); } while (myArray = allLinksRegex.exec(muligtLink)) //find all links { if (!regex.test(myArray[0])) //this link is not recognized { continue; } if (!span) span = document.createElement('span'); var link = myArray[0]; span.appendChild(document.createTextNode(muligtLink.substring(lastLastIndex, myArray.index))); //inds?t det der kommer for dette hit var $a = $("" + link + "") if (!link.match(/https?:\/\//)) { link = 'http://' + link; } $a.attr("href", link.replace(/\[\/hide:\w+\]/,"")) .addClass("processing_link") .appendTo(span); lastLastIndex = allLinksRegex.lastIndex; } if (span) { span.appendChild(document.createTextNode(muligtLink.substring(lastLastIndex))); //ins?t det der kommer efter sidste hit textNode.parentNode.replaceChild(span, textNode); } } } function add_WARLC_style() { if (!(document.getElementsByTagName('WARLC')[0])) { var meta_not_to_add_more_style = document.createElement("WARLC"); meta_not_to_add_more_style.setAttribute('content', 'war_links_checker'); meta_not_to_add_more_style.setAttribute('name', 'description'); document.getElementsByTagName('head')[0].appendChild(meta_not_to_add_more_style); alive_link_png = ""; adead_link_png = ""; unava_link_png = ""; prem_link_png = ""; switch(Icon_set) { //no icons case 0: break; // cat paws case 1: alive_link_png = PAW_ICON_GREEN; adead_link_png = PAW_ICON_RED; unava_link_png = PAW_ICON_YELLOW; prem_link_png = PAW_ICON_PINK; break; // classic RSLC look case 2: alive_link_png = RSLC_ICON_GREEN; adead_link_png = RSLC_ICON_RED; unava_link_png = RSLC_ICON_YELLOW; prem_link_png = RSLC_ICON_PINK; break; // New Icons case 3: alive_link_png = NEW_ICON_GREEN; adead_link_png = NEW_ICON_RED; unava_link_png = NEW_ICON_YELLOW; prem_link_png = NEW_ICON_PINK; break; // cat paws default:alive_link_png = PAW_ICON_GREEN; adead_link_png = PAW_ICON_RED; unava_link_png = PAW_ICON_YELLOW; prem_link_png = PAW_ICON_PINK; break; } processing_link_gif = 'data:image/gif;base64,' + // or temporary anavailable 'R0lGODlhCgAKAJEDAMzMzP9mZv8AAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAADACwAAAAACgAKAAACF5wncgaAGgJzJ647cWua4sOBFEd62VEAACH5BAUAAAMALAEAAAAIAAMAAAIKnBM2IoMDAFMQFAAh+QQFAAADACwAAAAABgAGAAACDJwHMBGofKIRItJYAAAh+QQFAAADACwAAAEAAwAIAAACChxgOBPBvpYQYxYAIfkEBQAAAwAsAAAEAAYABgAAAgoEhmPJHOGgEGwWACH5BAUAAAMALAEABwAIAAMAAAIKBIYjYhOhRHqpAAAh+QQFAAADACwEAAQABgAGAAACDJwncqi7EQYAA0p6CgAh+QQJAAADACwHAAEAAwAIAAACCpRmoxoxvQAYchQAOw%3D%3D'; var dead_color_css, live_color_css, unava_color_css, prem_color_css, black_background_css; if (Color_DL_links) { dead_color_css = 'color:' + Dead_links_color + ' !important;'; live_color_css = 'color:' + Live_links_color + ' !important;'; unava_color_css = 'color:' + Temp_unavailable_links_color + ' !important;'; container_color_css = 'color:' + Container_links_color + ' !important;'; prem_color_css = 'color:' + Premium_links_color + ' !important;'; } else { dead_color_css = live_color_css = unava_color_css = container_color_css = prem_color_css = ''; } if (Show_black_background_in_DL_links) { black_background_css = 'background-color: black !important;'; } else { black_background_css = ''; } if (Show_line_through_in_dead_links) { line_through_css = 'text-decoration: line-through !important;'; } else { line_through_css = ''; } GM_addStyle(".alive_link {background:transparent url(" + alive_link_png + ") no-repeat scroll 100% 50%;padding-right:15px;" + live_color_css + black_background_css + "}"); GM_addStyle(".adead_link {background:transparent url(" + adead_link_png + ") no-repeat scroll 100% 50%;padding-right:15px;" + dead_color_css + black_background_css + line_through_css + "}"); GM_addStyle(".unava_link {background:transparent url(" + unava_link_png + ") no-repeat scroll 100% 50%;padding-right:15px;" + unava_color_css + black_background_css + "}"); GM_addStyle(".processing_link {background:transparent url(" + processing_link_gif + ") no-repeat scroll 100% 50%;padding-right:15px;" + container_color_css + black_background_css + "}"); GM_addStyle(".container_link {background:transparent url(" + processing_link_gif + ") no-repeat scroll 100% 50%;padding-right:15px;" + container_color_css + black_background_css + "}"); GM_addStyle(".container_list {font-size:90%; list-style-type:square; padding: 0px 5% 0px; margin: 0px}"); GM_addStyle(".prem_link {background:transparent url(" + prem_link_png + ") no-repeat scroll 100% 50%;padding-right:15px;" + prem_color_css + black_background_css + "}"); } } var warlcTooltip = null; var mouseoverLink = null; //link href with mouse cursor over it var lastX = 0; var lastY = 0; $(document).ready(initTooltip); //inits tooltip function initTooltip() { warlcTooltip = document.createElement("div"); warlcTooltip.setAttribute("style", "background: #EAEAEA; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);padding: 6px 6px 6px 6px; border-radius:2px; border:2px solid #6699CC; color:#000000;font-family:Verdana,sans-serif;font-size:11px;position:absolute;z-index:1000; max-width: " + TOOLTIP_MAXWIDTH + "px;"); warlcTooltip.style.visibility = "hidden"; document.body.appendChild(warlcTooltip); } //"mousemove" event handler for all links function moveTooltip(event) { if ((Math.abs(lastX - event.clientX) + Math.abs(lastY - event.clientY)) < 6) { //no need to reflow if the cursor moved just a little return; } else { lastX = event.clientX; lastY = event.clientY; } posX = event.clientX + window.pageXOffset + 10; posY = event.clientY + window.pageYOffset; var ttHeight = warlcTooltip.offsetHeight; var ttFreeSpace = window.innerHeight - event.clientY; if (ttHeight > ttFreeSpace) { //prevents tooltip from getting out of the window posY -= (ttHeight - (ttFreeSpace)) + 10; } else { posY += 7; } warlcTooltip.style.top = posY + "px"; warlcTooltip.style.left = posX + "px"; } //"mouseout" event handler for all links function hideTooltip(){ warlcTooltip.style.visibility = "hidden"; mouseoverLink = null; } //"mouseover" event handler for dead links //displays tooltip error message on dead links function displayTooltipError() { mouseoverLink = this.href; this.addEventListener("mouseout", hideTooltip); this.addEventListener("mousemove", function(event) { moveTooltip(event); }); warlcTooltip.innerHTML = 'LOADING...'; warlcTooltip.style.minWidth = 0; warlcTooltip.style.visibility = "visible"; if (this.warlc_error) //an error message is already known and stored in warlc_error attribute { warlcTooltip.innerHTML = this.warlc_error; } else { loadErrorInfo(this); } function loadErrorInfo(link) { var href = link.href; href = href.replace(/quickshare\.cz\/.+/, "quickshare.cz/chyba"); GM_xmlhttpRequest({ method: 'GET', url: href.replace(Ref_anonymize_service, ""), headers: { 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey', 'Accept': 'text/xml', 'Referer': "" }, onload: function(result) { var res = result.responseText; //TODO: errorRegexs - var errorRegexs = [ //generic error messages follow /(empty directory)/i, /(soubor nebyl nalezen)/i, /((?:file|page|link|folder)(?:is|not|does|has been|was| ){1,}(?:found|available|blocked|exists?|deleted|removed))/i, //server specific error messages follow /msg error" style="cursor: default">(.+?)<\/div>/, //sendspace /color:red;font\-weight:bold;border\-style:dashed;font-size:12px;border\-width:2px;>
(.+?)<\/p>\s*<\/center>/, //letitbit /(?:error_div">|<\/h1>
)(.+?)<\/strong>/, //share-rapid,quickshare
/class="red">(.+?)<(?:span|br)>/, //czshare, megashares
/class="wp640">\s* (.+?)<\/p>/, //bayfiles
/(Your file could not be found. Please check the download link.)/, //stahnu.to
/error_msg">\s*( /, //bayfiles
/description">\s* Soubor: (.+?)<\/b>/, //bezvadata
/Complete name : (.+?) (?:.|\s)+?<\/p>/g;
var innerLinksRegex = /(?:Upload se nezdařil \((?:chyba serveru|chybné přihlašovací údaje)\)\. <|>https?:\/\/(?:.|\s)+?<|Právě probíhá reupload, buďte trpěliví\.\.\.<)/g;
var innerLinkRegex = /((?:Upload se nezdařil.+|https?:\/\/(?:.|\s)+|Právě probíhá reupload, buďte trpěliví\.\.\.));
var mlRestrictionRegex = new RegExp(hostRestrictionRegex,"g"); //what links should be displayed
var blocks; // blocks of links
var blockIdx;
mlLink.className = '';
if (result.status == 503) //service temporarily unavailable, repeat request in one second
{
setTimeout(function(){ processMultiloadLink(mlLink); }, 1000);
return;
}
blocks = res.match(innerBlockRegex);
if (blocks == null) //no links found, cancel further processing
{
mlLink.parentNode.appendChild(document.createTextNode(' | Požadovaný soubor neexistuje.'));
cMultiloadProcessed++;
if (cMultiloadTotal <= cMultiloadProcessed)
{
startBulkCheck('container_link');
start('container_link');
}
return;
}
blockIdx = blocks.length;
if (Display_full_links_in_link_containers)
{
var ulElm = document.createElement('ul');
ulElm.className = 'container_list'; //CSS smaller font, padding, margin, square style
while(blockIdx--)
{
if (blocks[blockIdx].match(mlRestrictionRegex) == null)
{
continue;
}
var innerLinks = blocks[blockIdx].match(innerLinksRegex);
var linkIdx = innerLinks.length;
while (linkIdx--)
{
var innerLink = innerLinks[linkIdx].match(innerLinkRegex)[1];
var liElm = document.createElement('li');
if (innerLink.match(/Upload se nezdařil|limit exceeded|probíhá reupload/))
{
liElm.appendChild(document.createTextNode(innerLink));
}
else
{
var aElm = document.createElement('a');
aElm.innerHTML = innerLink;
aElm.href = innerLink;
aElm.className = 'container_link';
liElm.appendChild(aElm);
}
ulElm.appendChild(liElm);
cLinksTotal++;
}
}
mlLink.parentNode.appendChild(ulElm);
}
else //compact view
{
mlLink.parentNode.appendChild(document.createTextNode("|"));
while(blockIdx--)
{
if (blocks[blockIdx].match(mlRestrictionRegex) == null)
{
continue;
}
var innerLinks = blocks[blockIdx].match(innerLinksRegex);
var linkIdx = innerLinks.length;
while (linkIdx--)
{
var innerLink = innerLinks[linkIdx].match(innerLinkRegex)[1];
if (innerLink.match(/Upload se nezdařil|limit exceeded|probíhá reupload/))
{
mlLink.parentNode.appendChild(document.createTextNode("----"));
}
else
{
var aElm = document.createElement('a');
var hostName = innerLink.match(/quickshare|hellshare|uloz\.to|multishare|hellspy|share\-rapid|czshare/);
//abbreviate host name
switch(hostName + ""){
case 'quickshare': aElm.innerHTML = 'QS'; break;
case 'hellshare': aElm.innerHTML = 'HS'; break;
case 'uloz.to': aElm.innerHTML = 'UT'; break;
case 'multishare': aElm.innerHTML = 'MS'; break;
case 'hellspy': aElm.innerHTML = 'hs'; break;
case 'share-rapid': aElm.innerHTML = 'SR'; break;
case 'czshare': aElm.innerHTML = 'CS'; break;
default: aElm.innerHTML = 'xx';
}
aElm.href = innerLink;
aElm.className = 'container_link';
mlLink.parentNode.appendChild(aElm);
cLinksTotal++;
}
}
mlLink.parentNode.appendChild(document.createTextNode("|")); //blocks delimiter
}
}
cMultiloadProcessed++;
if (cMultiloadTotal == cMultiloadProcessed) //start check when all ml links have been processed
{
if (Do_not_linkify_DL_links)
{
delinkifySnapshot(mlSnapshot);
}
startBulkCheck('container_link');
start('container_link');
}
}
});
}
if (GM_getValue("Check_mirrorcreator_dot_com_links", false))
{
var mcRegex = 'mirrorcreator\\.com/files/(\\w+)';
var mcXpath = "//a[contains(@href,'mirrorcreator.com/files')]";
var mcShortHostNames =
'?? RS MU ES DF Zs FF ?? SS ?? Ba NL LT MF MS ZS UL 2S ZI HF ST UP GF ?? UB Fr IF fs X7 UG ?? TB FS EB LB EU ?? OR ?? ?? DL EY ?? FK FH US BS WU FP PL FJ CR JF SM Ms Ff GU';
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
//?????? depositfiles sendspace load.to ul.to storage.to uploadbox x7.to fileserve ?????? duckload filehook filepost jumbofiles glumbouploads
// zshare ?????? 2shared uploading ugotfile extabit oron eyvx uploadstation putlocker
// megaupload badongo megashare gamefront ifile ?????? letitbit ?????? ?????? filejungle megashares
// easy-share ?????? netload zippyshare ?????? filesonic turbobit enterupload ?????? filekeen wupload crocko fileflyer
linkify(mcRegex);
var mcSnapshot = document.evaluate(mcXpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var mcCount = mcSnapshot.snapshotLength;
cMirrorcreatorComTotal = mcCount;
if (mcCount > 0)
{
mcShortHostNames = mcShortHostNames.split(' ');
mcIdx = mcCount;
while(mcIdx--)
processMirrorcreatorLink(mcSnapshot.snapshotItem(mcIdx));
}
}
//MIRRORCREATOR.CZ END
//mirrorcreator.com checking works like this:
//The base URL is http://www.mirrorcreator.com/files/XXXXXXXX/filename_links
//the actual list of mirrors is at http://www.mirrorcreator.com/status.php?uid=XXXXXXXX
//the list contains links in the form of (http://www.mirrorcreator.com)/redirect/XXXXXXXX/1
//these redirector links are extracted with mcLinkBlockRegex and the pages loaded
//they contain the actual filehost links, which are extracted with mcHostRegex and displayed in a container list
function processMirrorcreatorLink(mcLink)
{
var mcURL = mcLink.href.match(mcRegex);
if(!mcURL || !mcURL[1]) return;
mcURL = 'http://www.mirrorcreator.com/status.php?uid=' + mcURL[1]; //link correction
GM_xmlhttpRequest({
method: 'GET',
url: mcURL,
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*'+'/*;q=0.8',
'Referer': ""
},
onload: function(mcLinkResult) {
var mcLinkRes = mcLinkResult.responseText;
var mcLinkBlockRegex = /(\/redirect\/\w+\/(\d+))/gi;
var mcHostRegex = /(.+?)<\/h1>/, //uloz.to
/not-found">\s*
.+?<\/h3>
(.+?)<\/ul>)/, //edisk
/id="obsah">\s*
(.+?)<\/h2>/, //euroshare
/error">\s*(?:<[bp]>)?\s*(.+?)<\/[bp]>/, //filesmonster, shragle, gigapeta
///center aC">\s*
(.+?)
/, //uploaded.to
/icon_err">\s*(.+?)<\/h1>/, //filejungle
/Code: ER_NFF_\d+<\/h2>\s*(.+?)\s*<\/div>/, //netload
/(File has been removed due to Copyright Claim)/, //filerio
];
var errorIdx = errorRegexs.length;
var error = "Cause of error: unknown";
var errorCandidate = "";
while(errorIdx--)
{
var errorCandidate = res.match(errorRegexs[errorIdx]);
if (errorCandidate != null)
{
error = "Cause of error: " + errorCandidate[1].replace(/ /g," ") + "";
break;
}
}
//link attributes
link.warlc_error = error;
if (mouseoverLink == link.href) //mouse cursor is still over the link
{
warlcTooltip.innerHTML = error;
}
}
});
}
}
//"mouseover" event handler for alive links
//displays tooltip info (file size, file name,...) on alive links
function displayTooltipInfo()
{
mouseoverLink = this.href;
//exclude direct download filehostings
if (this.href.match(/(?:uloziste\.com|filemonster\.net|uploadbin\.net|loombo\.com|adrive\.com|myupload\.dk|storage\.novoro\.net|ubuntuone\.com|multi-debrid\.com\/directdl|mms\.multishare\.cz\/html\/mms_process\.php|zevera\.com\/getFiles|filesmelt\.com)/))
{
return;
}
this.addEventListener("mouseout", hideTooltip);
this.addEventListener("mousemove", function(event) { moveTooltip(event); });
warlcTooltip.innerHTML = 'LOADING...';
warlcTooltip.style.minWidth = 0;
warlcTooltip.style.visibility = "visible";
if (this.warlc_tooltipcache) //file size is already known and stored in warlc_filename and warlc_filesize attributes
{
warlcTooltip.innerHTML = this.warlc_tooltipcache;
}
else
{
loadInfo(this);
}
function loadInfo(link)
{
var href = link.href;
GM_xmlhttpRequest({
method: 'GET',
url: href.replace(Ref_anonymize_service, ""),
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/xml',
'Referer': ""
},
onload: function(result) {
var res = result.responseText;
var nameRegexs = [ /Filename: (.+?)<\/b>/, //oron
/(?:finfo|file[-_]?name)">\s*(.+?)<\/?(?:h1|a|div|span style|td)/, //hellshare, netload, badongo, 4fastfile
/fl" title="(.+?)">/, //edisk
/
Stahujete soubor: <\/h3>\s*
(.+?)<\/b><\/h3>
/, //fastshare
/title="download (.+?)">/, //sendspace
/Stáhnout soubor: (.+?)<\/h1>/, //quickshare
/fz24">Download:\s*(.+?)<\/strong>/, //crocko
/'file\-icon\d+ \w+'>(?:<\/span>)?(.+?)<\/span>/, //hitfile, turbobit
/d0FileName = "(.+?)";/, //letitbit
/file(?:_name|-info)" title="">\w+: (.+?)<\/span>/, //vip-file, shareflare
/recent-comments">(.+) /, //xdisk
/fname" value="(.+?)">/, //syfiles, grupload,
/download\-header">\s*
File:<\/h2>\s*
/, //bezvadata
/itemprop="name">(.+?)<\/span>/, //bezvadata
];
var nameIdx = nameRegexs.length;
// [sizeRegexs]
// / \ \?
// prefix (size) postfix
// / \
// val quant
var quantRegex = '(?:M|G|K)?i?(?:B)(?:[y|i]te?s?)?';
var valRegex = '\\d+(?:[\\., ]\\d+){0,2}'; // 111([., ]222)?([., ]333)?
var uniSizeRegex = valRegex + '(?:\\s*| )' + quantRegex;
var preSizeRegex = '(?::|\\(|>|>, | - )';
var postSizeRegex = '(?:\\))?';
var sizeRegexs = [ preSizeRegex + "\\s*(" + uniSizeRegex + ")\\s*" + postSizeRegex,
'FileSize_master">(.+?)<\/strong>', //hellshare
];
var sizeIdx = sizeRegexs.length;
//
//
var tooltip = "File Name: ";
var fileName = "unknown";
var nameCandidate = "";
while(nameIdx--)
{
var nameCandidate = res.match(nameRegexs[nameIdx]);
if (nameCandidate != null)
{
fileName = nameCandidate[1].replace(/ /g," ");
break;
}
}
tooltip += fileName + "
File Size: ";
var fileSize = "unknown";
var sizeCandidate = "";
while(sizeIdx--)
{
sizeCandidate = res.match(new RegExp(sizeRegexs[sizeIdx], "i"));
if (sizeCandidate != null)
{
fileSize = sizeCandidate[1].replace(/ /g," ");
if (/^\d+$/.test(fileSize) && fileSize >= 1024) //assume bytes
{
if(fileSize > (1<<30)) fileSize = Math.round(10 * fileSize / (1<<30)) / 10 + ' GB';
else if(fileSize > (1<<20)) fileSize = Math.round(fileSize / (1<<20)) + ' MB';
else fileSize = Math.round(fileSize / 1024) + ' KB';
}
break;
}
}
tooltip += fileSize + "";
// PROTOTYPE
// video thumbnails
if (href.match('hellshare'))
{
var thumbs;
thumbs = res.match(/http:\/\/static\d+\.helldata\.com\/thumbs(?:\/\d+){1,2}\/\d{1,2}"/g);
if (thumbs)
{
tooltip += '
';
var j = Math.min(thumbs.length, 9);
for (var i = 0; i < j; i++)
{
tooltip += '';
}
warlcTooltip.style.minWidth = TOOLTIP_MAXWIDTH;
}
}
if (href.match('czshare'))
{
var thumbs;
thumbs = res.match(/src="http:\/\/www(\d+)\.czshare\.com\/images_velke\/\d+\.(\d+)\.jpeg/);
if (thumbs)
{
var thumbsServer = thumbs[1];
var thumbsId = thumbs[2];
tooltip += '
';
for (var i = 1; i < 9; i++)
{
tooltip += '';
}
warlcTooltip.style.minWidth = TOOLTIP_MAXWIDTH;
}
}
if (href.match('bezvadata'))
{
var thumbs;
thumbs = res.match(/http:\/\/nahledy\.bezvadata\.cz\/nahledy\/\d+\/\d+\/\d+_\d+_\d+x\d+_\w.jpg/g);
if (thumbs)
{
tooltip += '
';
var j = Math.min(thumbs.length, 9);
for (var i = 0; i < j; i++)
{
tooltip += '';
}
warlcTooltip.style.minWidth = TOOLTIP_MAXWIDTH;
}
}
link.warlc_tooltipcache = tooltip;
if (mouseoverLink == link.href) //mouse cursor is still over the link
{
warlcTooltip.innerHTML = tooltip;
}
}
});
}
}
function setVariables()
{
if (firstRun)
{
GM_log('First run, applying default settings...');
GM_setValue("Icon_set",1);
GM_setValue("Display_tooltip_info",true);
GM_setValue("Show_black_background_in_DL_links",false);
GM_setValue("Show_line_through_in_dead_links",false);
GM_setValue("Display_full_links_in_link_containers",false);
GM_setValue("Allow_spaces_in_DL_links",false);
GM_setValue("Autocheck",true);
GM_setValue("Enable_Anonymizer",false);
GM_setValue("Do_not_linkify_DL_links",false);
GM_setValue("Show_progress_stats",true);
GM_setValue("Keyboard_functions",true);
GM_setValue("Obsolete_file_hosts",false);
GM_setValue("Color_DL_links",true);
GM_setValue("Live_links_color","Green");
GM_setValue("Dead_links_color","#FF3300");
GM_setValue("Temp_unavailable_links_color","#F7EF09");
GM_setValue("Container_links_color","DarkKhaki");
GM_setValue("Premium_links_color","DeepPink");
GM_setValue("Ref_anonymize_service","http://hiderefer.com/?");
GM_setValue("Custom_rules",false);
GM_setValue("Custom_rules_text","");
GM_setValue("First_run", false);
}
//hidden settings
GM_setValue("Progress_box_pos_bottom", Progress_box_pos_bottom = GM_getValue("Progress_box_pos_bottom", 20));
GM_setValue("Progress_box_pos_right", Progress_box_pos_right = GM_getValue("Progress_box_pos_right", 10));
GM_setValue("Progress_box_opacity", Progress_box_opacity = GM_getValue("Progress_box_opacity", 85));
GM_setValue("Progress_box_background_color", Progress_box_background_color = GM_getValue("Progress_box_background_color", 'DimGray'));
GM_setValue("Progress_box_item_color", Progress_box_item_color = GM_getValue("Progress_box_item_color", 'DimGray'));
GM_setValue("Progress_box_refresh_rate", Progress_box_refresh_rate = GM_getValue("Progress_box_refresh_rate", 2000));
GM_setValue("Debug_mode", DEBUG_MODE = GM_getValue("Debug_mode", false));
//hidden settings end
Icon_set = GM_getValue("Icon_set", 1); //0 - no icons, 1 - cat paws, 2 - old RSLC style, 3 - New Icons,
Display_tooltip_info = GM_getValue("Display_tooltip_info", true);
Show_black_background_in_DL_links = GM_getValue("Show_black_background_in_DL_links", false);
Show_line_through_in_dead_links = GM_getValue("Show_line_through_in_dead_links", false);
Display_full_links_in_link_containers = GM_getValue("Display_full_links_in_link_containers", false);
Allow_spaces_in_DL_links = GM_getValue("Allow_spaces_in_DL_links", false);
Autocheck = GM_getValue("Autocheck", true);
Enable_Anonymizer = GM_getValue("Enable_Anonymizer", false);
Do_not_linkify_DL_links = GM_getValue("Do_not_linkify_DL_links", false);
Show_progress_stats = GM_getValue("Show_progress_stats", true);
Keyboard_functions = GM_getValue("Keyboard_functions", true);
Obsolete_file_hosts = GM_getValue("Obsolete_file_hosts", false);
Color_DL_links = GM_getValue("Color_DL_links", true);
Live_links_color = GM_getValue("Live_links_color", "Green");
Dead_links_color = GM_getValue("Dead_links_color", "#FF3300");
Temp_unavailable_links_color = GM_getValue("Temp_unavailable_links_color", "#F7EF09");
Container_links_color = GM_getValue("Container_links_color", "DarkKhaki");
Premium_links_color = GM_getValue("Premium_links_color", "DeepPink");
Ref_anonymize_service = GM_getValue("Ref_anonymize_service", "http://hiderefer.com/?");
Custom_rules = GM_getValue("Custom_rules", false);
Custom_rules_text = GM_getValue("Custom_rules_text", false);
}
// Delinkifies the links
// params:
// links -> list of links or link components (note they should be sufficiently unique to identify the link on page,
// e.g. 'uloz.to/xs68skxl8')
function delinkifySnapshot(snapshot)
{
var n = snapshot.snapshotLength;
while (n--)
{
thisLink = snapshot.snapshotItem(n);
var spanElm = document.createElement("span");
spanElm.className = thisLink.className;
spanElm.innerHTML = thisLink.innerHTML;
if (Display_tooltip_info)
{
spanElm.href = thisLink.href;
switch (thisLink.className){
case "alive_link": spanElm.addEventListener("mouseover", displayTooltipInfo, false); break
case "adead_link": spanElm.addEventListener("mouseover", displayTooltipError, false); break;
case "unava_link": //reserved
default:
}
}
thisLink.parentNode.replaceChild(spanElm, thisLink);
}
}
function processContainers()
{
var redirectorTypes = { "HTTP_302": 0,
"INNER_LINK": 1,
"THELOO_KATT_IT": 2,
"CING_BE": 3,
"ADF_LY": 4};
var cMultiloadTotal = 0;
var cMultiloadProcessed = 0;
var cMirrorcreatorComTotal = 0;
var cMirrorcreatorComProcessed = 0;
var hostRestrictionRegex = "";
var multiloadComRestriction = "";
var multiloadComRestrictionRegex;
//
//HANDLING REDIRECTORS START
//
var redirectors = new Array();
initRedirectors();
var redirectorsCount = redirectors.length;
if (redirectorsCount > 0)
{
var allRedirectorsRegex = "";
//linkify redirector links
for(var redirIdx = 0; redirIdx < redirectorsCount; redirIdx++)
{
allRedirectorsRegex += redirectors[redirIdx].linkRegex + "|";
}
allRedirectorsRegex = allRedirectorsRegex.replace(/\|$/, "");
linkify(allRedirectorsRegex);
//
//process redirector links
for(var redirIdx = 0; redirIdx < redirectorsCount; redirIdx++)
{
var redirectorsSnapshot = document.evaluate(redirectors[redirIdx].xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
redirectors[redirIdx].cTotal = redirectorsSnapshot.snapshotLength;
cLinksTotal += redirectors[redirIdx].cTotal;
var linkIdx = redirectors[redirIdx].cTotal;
while(linkIdx--)
{
switch(redirectors[redirIdx].type)
{
case redirectorTypes.HTTP_302: processRedirectorLink(redirectorsSnapshot.snapshotItem(linkIdx), redirIdx); break;
case redirectorTypes.INNER_LINK: processRedirectorLinkEx(redirectorsSnapshot.snapshotItem(linkIdx), redirIdx); break;
case redirectorTypes.THELOO_KATT_IT: processThelooKattItLink(redirectorsSnapshot.snapshotItem(linkIdx), redirIdx); break;
case redirectorTypes.CING_BE: processCingBeLink(redirectorsSnapshot.snapshotItem(linkIdx), redirIdx); break;
case redirectorTypes.ADF_LY: processAdfLyLink(redirectorsSnapshot.snapshotItem(linkIdx), redirIdx); break;
default:
}
}
}
//
}
//HTTP_302
function processRedirectorLink(link, redirectorId)
{
link.className = 'container_link';
GM_xmlhttpRequest({
method: 'HEAD',
url: link.href,
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/xml',
'Referer': ""
},
onload: function(result) {
if (result.finalUrl.replace("https", "http") == link.href) // service hasn't redirected anywhere
{
processRedirectorLink(link, redirectorId);
}
else
{
redirectors[redirectorId].cProcessed++;
link.href = result.finalUrl;
if (redirectors[redirectorId].cProcessed >= redirectors[redirectorId].cTotal)
checkLinks('container_link');
}
},
onerror: function(result) { //probably caused by unresponsive filehosting
redirectors[redirectorId].cProcessed++;
link.className = 'unava_link';
cLinksProcessed++;
if (redirectors[redirectorId].cProcessed >= redirectors[redirectorId].cTotal)
checkLinks('container_link');
}
});
}
//INNER_LINK
function processRedirectorLinkEx(link, redirectorId)
{
link.className = 'container_link';
GM_xmlhttpRequest({
method: 'GET',
url: link.href,
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/xml',
'Referer': ""
},
onload: function(result) {
link.href = result.responseText.match(redirectors[redirectorId].innerLinkRegex)[1];
redirectors[redirectorId].cProcessed++;
if (redirectors[redirectorId].cProcessed >= redirectors[redirectorId].cTotal)
checkLinks('container_link');
}
});
}
//theloo.katt.it (wrapped safelinking.net)
function processThelooKattItLink(link, redirectorId)
{
link.className = 'container_link';
GM_xmlhttpRequest({
method: 'GET',
url: link.href,
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/xml',
'Referer': ""
},
onload: function(result) {
link.href = result.responseText.match(redirectors[redirectorId].innerLinkRegex)[1];
redirectors[redirectorId].cProcessed++;
//the inner links are safelinking.net links, so lets proceed with it
if (GM_getValue("Check_safelinking_dot_net_links", false))
{
processRedirectorLink(link, 0);
}
}
});
}
//adf.ly (adf.ly/go innerLink, locking mechanism)
function processAdfLyLink(link, redirectorId)
{
link.className = 'container_link';
GM_xmlhttpRequest({
method: 'GET',
url: link.href,
headers: {
'User-agent': 'Mozilla/4.0',
'Accept': 'text/xml',
'Referer': ""
},
onload: function(result) {
if (result.finalUrl.match('/locked/'))
{
var delay = result.responseText.match(/countdown">(\d+))[1];
// GM_log(result.finalUrl + 'is locked. Repeating the request in ' + delay + 's.');
// setTimeout(function(){processAdfLyLink(link, redirectorId);}, delay * 1000);
}
else
{
// GM_log('Processing... ' + link.href);
// GM_log('Found...' + result.responseText.match(/\/go\/(\w+\/\w+)/)[1]);
var directLink = 'http://adf.ly' + result.responseText.match(/(\/go\/\w+\/\w+)/)[1];
var logToken = result.responseText.match(/flashy_(\w+)/)[1];
var users = result.responseText.match(/user=\d+&user2=\d+/);
//confirm advert
GM_xmlhttpRequest(
{
method: 'POST',
url: 'http://adf.ly/l.php',
headers: {
'User-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0',
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer': link.href
},
data: users + '<=' + logToken,
onload: function(result) {
//retrieve final url from .../go/... link
GM_xmlhttpRequest({
method: 'GET',
url: directLink,
headers: {
'User-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Referer': link.href
},
onload: function(result) {
link.href = result.finalUrl;
redirectors[redirectorId].cProcessed++;
if (redirectors[redirectorId].cProcessed >= redirectors[redirectorId].cTotal)
checkLinks('container_link');
}
});
}
});
}
}
});
function proceedOK()
{
}
}
//MULTILOAD.CZ START
if (GM_getValue("Check_multiload_dot_cz_links", false))
{
var mlRegex = 'multiload\\.cz\/stahnout\/\\d+\/';
var mlXpath = "//a[contains(@href,'http://www.multiload.cz/stahnout')]";
hostRestrictionRegex = 'Upload se nezdařil|limit exceeded|probíhá reupload|';
if (GM_getValue("Check_hellshare_dot_com_links", false))
hostRestrictionRegex += 'hellshare|';
if (GM_getValue("Check_share_dash_rapid_dot_com_links", false))
hostRestrictionRegex += 'share-rapid\\.com|';
if (GM_getValue("Check_quickshare_dot_cz_links", false))
hostRestrictionRegex += 'quickshare\\.cz|';
if (GM_getValue("Check_czshare_dot_com_links", false))
hostRestrictionRegex += 'czshare\\.com|';
if (GM_getValue("Check_uloz_dot_to_links", false))
hostRestrictionRegex += 'uloz\\.to|';
if (GM_getValue("Check_hellspy_dot_com_links", false))
hostRestrictionRegex += 'hellspy|';
if (GM_getValue("Check_multishare_dot_cz_links", false))
hostRestrictionRegex += 'multishare\\.cz|';
hostRestrictionRegex = hostRestrictionRegex.replace(/\|$/, "");
linkify(mlRegex);
var mlSnapshot = document.evaluate(mlXpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var mlCount = mlSnapshot.snapshotLength;
if (mlCount > 0)
{
cMultiloadTotal += mlCount;
mlIdx = mlCount - 1;
do
{
processMultiloadLink(mlSnapshot.snapshotItem(mlIdx));
}
while(mlIdx--)
}
}
//MULTILOAD.CZ END
function processMultiloadLink(mlLink)
{
GM_xmlhttpRequest({
method: 'GET',
url: mlLink.href,
headers: {
'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/xml',
'Referer': ""
},
onload: function(result) {
var res = result.responseText;
var innerBlockRegex = /