// ==UserScript== // @name Free host download // @namespace http://tampermonkey.net/ // @version 1.4 // @description free down it // @author kingweb // @license MIT // @match https://www.dudujb.com/* // @match https://www.iycdn.com/* // @match http://www.xunniufxp.com/* // @match http://www.xueqiupan.com/* // @match https://www.567yun.cn/* // @match https://www.77file.com/* // @match https://ownfile.net/* // @match https://www.ayunpan.com/* // @grant none // @downloadURL none // ==/UserScript== (function () { 'use strict'; var domain = window.location.host; let str = document.documentElement.outerHTML; let file_url = window.location.href; //select the domain if(domain == 'www.ayunpan.com') { jumpTo(file_url); } if (domain == 'ownfile.net') { if (file_url.includes("/files/")) { var urlParts = file_url.split('/'); var dynamicParam = urlParts[urlParts.length - 1].split('.')[0]; if (dynamicParam) { window.location.href = 'https://ownfile.net/down/' + dynamicParam + '.html'; } else { alert('获取参数失败'); } } if (file_url.includes("/down/")) { let scriptContent = document.body.innerHTML; var regex = /load_down_addr1\('([^']+)'\)/g; var match = regex.exec(scriptContent); let file_id = match[1]; load_down_addr1(file_id); setTimeout(function () { var s1 = setInterval(()=>{ if (document.getElementById("addr_list")) { var href = $("#addr_list a").attr("href");; if (href && href.includes("file_id")) { $('#down_box h4').text('如果未列出有效地址,将会自动刷新,直到出现有效地址'); load_down_addr1(file_id); } else { clearInterval(s1); } } }, 1000); }, 1000); } } if (domain == 'www.77file.com') { if (file_url.includes("/s/")) { var urlParts = file_url.split('/'); var dynamicParam = urlParts[urlParts.length - 1]; window.location.href = '/down/' + dynamicParam + '.html'; } if (file_url.includes("/down/")) { let scriptContent = document.body.innerHTML; var regex = /load_down_addr1\('([^']+)'\)/g; var match = regex.exec(scriptContent); let file_id = match[1]; let element = document.getElementById("addr_box"); element.parentNode.removeChild(element); load_down_addr1(file_id); } } if (domain == 'www.567yun.cn') { jumpTo(file_url); show_down_url_load_down_addr1(file_url); } if (domain == 'www.xueqiupan.com') { jumpTo(file_url); show_down_url_load_down_addr1(file_url); } if (domain == 'www.xunniufxp.com') { jumpTo(file_url); show_down_url_load_down_addr1(file_url); } if (domain == 'www.iycdn.com') { jumpTo(file_url); //判断当前 url 包含 down-2224.html if (file_url.indexOf('down-') > -1) { let down_box = document.getElementById('down_box'); down_box.style.display = ''; let file_id = get_down_url_id(file_url); //get download list $.ajax({ type: 'post', url: 'ajax.php', data: 'action=load_down_addr2&file_id=' + file_id, dataType: 'text', success: function (msg) { var arr = msg.split('|'); if (arr[0] == 'true') { $('#addr_list').html(arr[1]); $('#code_box').hide(); } else { $('#addr_list').html(msg); } }, error: function () { } }); } } if (domain == 'www.dudujb.com') { jumpTo(file_url); //判断当前 url 包含 down-2224.html if (file_url.indexOf('down-') > -1) { let down_box = document.getElementById('down_box'); down_box.style.display = ''; let file_id = get_down_url_id(file_url); //get download list $.ajax({ type: 'post', url: 'ajax.php', data: 'action=load_down_addr2&file_id=' + file_id, dataType: 'text', success: function (msg) { var arr = msg.split('|'); if (arr[0] == 'true') { $('#addr_list').html(arr[1]); $('#code_box').hide(); } else { $('#addr_list').html(msg); } }, error: function () { } }); } } //Some common methods //junmp to url function jumpTo(file_url) { if (file_url.indexOf('file-') > -1) { let file_id = get_file_url_id(file_url); if (file_id) { window.location.href = 'down-' + file_id + '.html'; } } } //get file url id function get_file_url_id(url) { let matches = url.match(/file-(\d+)/); if (matches[1]) { return matches[1]; } else { alert('获取文件ID失败'); } } //get down url id function get_down_url_id(file_url) { let matches = file_url.match(/down-(\d+)/); if (matches[1]) { return matches[1]; } else { alert('获取文件ID失败'); } } //don't need ajax show download list function show_down_url_load_down_addr1(file_url) { if (file_url.indexOf('down-') > -1) { let down_box = document.getElementById('down_box'); down_box.style.display = ''; $("#codefrm").parent().hide(); load_down_addr1(get_down_url_id(file_url)); } } function get_add_ref() { let id = document.documentElement.outerHTML.match(/add_ref\((\S*)\);/)[1]; if (id) { return id; } else { alert('查找文件 ID 错误'); } } })();