网盘自动提取码 was reported 2021-06-10 by msoop as an unauthorized copy of 网盘提取工具.

网盘提取工具 does not specify a license, which means distributing copies is not allowed unless explicit permission is given.

Script License Created Updated
Reported 网盘自动提取码 N/A 2018-11-12 19:04:08 UTC 2018-11-12 19:04:07 UTC
Original 网盘提取工具 N/A 2016-04-13 06:33:25 UTC 2020-07-03 11:43:35 UTC
  • // ==UserScript==
  • -// @name 网盘提取工具
  • -// @namespace http://www.fishlee.net/
  • -// @version 3.3
  • -// @description 尽可能在支持的网盘自动输入提取码,省去下载的烦恼。
  • -// @author 木鱼(iFish)
  • +// @name 网盘自动提取码
  • +// @namespace https://guihet.com/
  • +// @version 1.0
  • +// @description 百度网盘|蓝奏网盘下载链接自动填写提取码
  • +// @author 黑鸟
  • // @match *://*/*
  • // @grant unsafeWindow
  • -// @icon https://ssl-static.fishlee.net/resources/emot/xr/22.gif
  • // ==/UserScript==
  • (function(window, self, unsafeWindow) {
  • 'use strict';
  • - let timeStart = new Date().getTime();
  • + let timeStart = new Date().getTime();//计算运行时间Start
  • let location = self.location;
  • let host = location.host;
  • let path = location.pathname;
  • let code, input;
  • let getCode = function(rule) {
  • + //即#号后面的内容即提取码
  • code = location.hash.slice(1, 5);
  • if ((rule || /([a-z\d]{4})/i.exec(code))) {
  • code = RegExp.$1;
  • return code;
  • };
  • if (/(pan|e?yun)\.baidu\.com/.test(host)) {
  • - //百度
  • + //百度
  • if (path.indexOf("/share/") !== -1 && document.querySelector('form[name="accessForm"]') && getCode()) {
  • let target = document.querySelector('.pickpw input');
  • if (!target)
  • + {
  • return;
  • + }
  • target.value = code;
  • unsafeWindow.document.querySelector('form[name="accessForm"]').onsubmit();
  • }
  • - } else if (/\.lanzou[sx]?\.com/.test(host) && getCode()) {
  • + } else if (/(pan|d|www)\.lanzous?\.com/.test(host) && getCode()) {
  • + //蓝奏网盘
  • +
  • let target = document.querySelector('#pwd');
  • if (!target)
  • + {
  • return;
  • -
  • - target.value = code;
  • - let btn = unsafeWindow.document.querySelector('#sub') || unsafeWindow.document.querySelector('.passwddiv-btn');
  • -
  • - btn && btn.dispatchEvent(new UIEvent('click'));
  • - } else if (/cloud.189.cn/.test(host) && getCode()) {
  • - let target = document.getElementById('code_txt');
  • - if (!target)
  • - return;
  • -
  • - target.value = code;
  • -
  • - let nameLabel = document.querySelector('.shareDate');
  • - let delayFunc = () => {
  • - if (!nameLabel.innerText) {
  • - console.log('delay 500ms due to page load not complete.');
  • - setTimeout(delayFunc, 500);
  • - } else {
  • - unsafeWindow.$(target.nextElementSibling).click();
  • }
  • - };
  • - setTimeout(delayFunc, 500);
  • + target.value = code;
  • + unsafeWindow.document.querySelector('#sub').dispatchEvent(new UIEvent('click'));
  • } else {
  • //其它网站,检测链接
  • - Array.prototype.slice.call(document.querySelectorAll("a[href*='pan.baidu.com'], a[href*='lanzou.com'], a[href*='lanzous.com'], a[href*='lanzoux.com']")).forEach(function(link) {
  • + Array.prototype.slice.call(document.querySelectorAll("a[href*='pan.baidu.com'], a[href*='lanzou.com'], a[href*='lanzous.com']")).forEach(function(link) {
  • let txt = link.nextSibling && link.nextSibling.nodeValue;
  • let linkcode = /码.*?([a-z\d]{4})/i.exec(txt) && RegExp.$1;
  • if (!linkcode) {
  • walk = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null, false);
  • while ((n = walk.nextNode())) {
  • if (n.nodeName === '#text')
  • + {
  • a.push(n);
  • }
  • + }
  • return a;
  • };
  • let generalLinkifyText = function(source, eles, index, testReg, validateRule) {
  • let originalText = (match[1] || "") + match[2];
  • let code = match[3] || findCodeFromElements(eles, index, validateRule) || "";
  • if (!code)
  • + {
  • continue;
  • + }
  • console.log("[网盘提取工具] 已处理网盘地址,URL=" + url + ",提取码=" + code + "模式:TEXTNODE");
  • //fix double #
  • url = url.split('#')[0];
  • let linkifyTextBlockLanZou = function(...args) {
  • return generalLinkifyText(...[
  • ...args,
  • - /(https?:\/\/)?((?:pan|d|www)\.lanzou[sx]?\.com\/(?:[a-z\d]+))(?:.*?码.*?([a-z\d]+))?/gi,
  • + /(https?:\/\/)?((?:pan|d|www)\.lanzous?\.com\/(?:[a-z\d]+))(?:.*?码.*?([a-z\d]+))?/gi,
  • CODE_RULE_COMMON
  • ]);
  • };
  • - let linkifyTextBlock189cn = function(...args) {
  • - return generalLinkifyText(...[
  • - ...args,
  • - /(https?:\/\/)?(cloud\.189?\.cn\/t\/(?:[a-z\d]+))(?:.*?码.*?([a-z\d]+))?/gi,
  • - CODE_RULE_COMMON
  • - ]);
  • - }
  • let findCodeFromElements = function(eles, index, rule) {
  • for (let i = 0; i < MAX_SEARCH_CODE_RANGE && i < eles.length; i++) {
  • let txt = eles[i + index].textContent;
  • let eles = textNodesUnder(document.body);
  • let processor = [
  • linkifyTextBlockBaidu,
  • - linkifyTextBlockLanZou,
  • - linkifyTextBlock189cn
  • + linkifyTextBlockLanZou
  • ];
  • for (let i = 0; i < eles.length; i++) {
  • let ele = eles[i];
  • - if (ele.parentNode.tagName == 'a' || !ele.textContent) continue;
  • + if (ele.parentNode.tagName == 'a') continue;
  • let txt = ele.textContent;
  • let loopCount = 0;

This report has been upheld by a moderator.