Greasy Fork

Greasy Fork is available in English.

网盘助手

点击文件直接下载或跳转:蓝凑云、猫狸盘搜

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         网盘助手
// @version      0.0.1
// @namespace    airbash/Netdiskassistant
// @homepageURL  https://github.com/AirBashX/UserScript
// @author       airbash
// @description  点击文件直接下载或跳转:蓝凑云、猫狸盘搜
// @match        *://*.lanzoub.com/*
// @match        *://*.lanzouc.com/*
// @match        *://*.lanzoue.com/*
// @match        *://*.lanzouf.com/*
// @match        *://*.lanzouh.com/*
// @match        *://*.lanzoui.com/*
// @match        *://*.lanzouj.com/*
// @match        *://*.lanzouk.com/*
// @match        *://*.lanzoul.com/*
// @match        *://*.lanzoum.com/*
// @match        *://*.lanzouo.com/*
// @match        *://*.lanzoup.com/*
// @match        *://*.lanzouq.com/*
// @match        *://*.lanzout.com/*
// @match        *://*.lanzouu.com/*
// @match        *://*.lanzouv.com/*
// @match        *://*.lanzouw.com/*
// @match        *://*.lanzoux.com/*
// @match        *://*.lanzouy.com/*
// @match        *://*.lanzob.com/*
// @match        *://*.lanzoe.com/*
// @match        *://*.lanzof.com/*
// @match        *://*.lanzoh.com/*
// @match        *://*.lanzoi.com/*
// @match        *://*.lanzoj.com/*
// @match        *://*.lanzol.com/*
// @match        *://*.lanzom.com/*
// @match        *://*.lanzoo.com/*
// @match        *://*.lanzop.com/*
// @match        *://*.lanzoq.com/*
// @match        *://*.lanzov.com/*
// @match        *://*.lanzow.com/*
// @match        *://*.lanzox.com/*
// @match        *://*.lanzoy.com/*
// @match        *://pan.lanzou.com/*
// @match        *://pc.woozooo.com/*
// @match        *://www.alipansou.com/*
// @connect      www.aliyundrive.com
// @grant        GM_openInTab
// @grant        GM_xmlhttpRequest
// @grant        window.close
// @license      GPL-3.0
// @run-at       document-start
// ==/UserScript==

(function () {
    "use strict";
    const website_url = location.href;
    //猫狸网盘:文件页
    if (website_url.search("www.alipansou.com/search?") != -1) {
        onload = function () {
            let file_lists = document.querySelectorAll('.van-row a[href^="/s/"]');
            for (let list of file_lists) {
                list.parentElement.addEventListener("click", function (e) {
                    e.preventDefault(); // 阻止默认打开链接事件
                    //自动打开网盘
                    GM_xmlhttpRequest({
                        url: list.href.replace("/s/", "/cv/"),
                        headers: {
                            referer: list.href,
                        },
                        onload: function (response) {
                            GM_openInTab(response.finalUrl, { active: true });
                        },
                    });
                });
            }
        };
        //猫狸网盘:跳转页
    } else if (website_url.search("www.alipansou.com/s/") != -1) {
        //关闭关注提示:可有可无
        document.cookie = "no_show_donate=1;max-age=100000000";

        GM_xmlhttpRequest({
            url: website_url.replace("/s/", "/cv/"),
            headers: {
                referer: website_url,
            },
            onload: function (response) {
                GM_openInTab(response.finalUrl, { active: true });
                window.close();
            },
        });
    } else {
        let inter = setInterval(() => {
            //蓝凑云盘:列表页
            let file_lists = document.querySelectorAll("#infos a");
            if (file_lists.length > 0) {
                for (let list of file_lists) {
                    list.addEventListener("click", function (e) {
                        e.preventDefault(); // 阻止默认打开链接事件
                        GM_openInTab(list.href); // 后台打开
                    });
                }
                clearInterval(inter);
            }

            //蓝凑云盘:跳转页
            let download_file = document.querySelector("#tourl a");
            if (download_file) {
                GM_openInTab(download_file.href);
                window.top.close();
            }
        }, 1000);
    }
})();