悄悄说一句,就是关于优雅下载的,估计好多人已经知道了

五级用户 立宝宝龙 2023-4-18 5349


上一篇:马力欧电影6亿票房登顶游戏史 / 世嘉宣布54亿收购《愤怒的小鸟》开发商
下一篇:老爱爱,有个请求,可不可以。
最新回复 (30)
  • 五级用户 立宝宝龙 2023-4-19
    0 21
    hznwexy 晕,被举报了
    6
  • 四级用户 读书读坏脑 2023-4-19
    0 22
    已经下载的能分享下源码吗,页面已经被举报了
  • 五级用户 立宝宝龙 2023-4-19
    0 23
    jeanszhang 已经下载的能分享下源码吗,页面已经被举报了
    没办法了~只能等了
  • 五级用户 ma_er233 2023-4-19
    0 24
    jeanszhang 已经下载的能分享下源码吗,页面已经被举报了
    // ==UserScript==

    // @name 百度网盘不限速下载-KubeDown
    // @description 百度网盘不限速下载-KubeDown-Script

    // @version 1.0
    // @author KubeDown

    // @antifeature membership

    // @license AGPL-3.0

    // @icon https://p0.meituan.net/csc/6a347940f064146525be36b80541490124528.png

    // @resource https://cdn.staticfile.org/limonte-sweetalert2/11.7.1/sweetalert2.min.css

    // @require https://cdn.staticfile.org/limonte-sweetalert2/11.7.1/sweetalert2.all.min.js
    // @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js

    // @grant          GM_xmlhttpRequest

    // @match *://pan.baidu.com/*

    // @connect      127.0.0.1
    // @connect      api.kubedown.com

    // @connect      p0.meituan.net

    // @connect      cdn.staticfile.org

    // @connect      pan.baidu.com

    // @namespace https://greasyfork.org/users/1045131
    // ==/UserScript==

    (() => {
        AddElement();

        function AddElement() {
            if (document.getElementById("KubeDown") === null) {
                const newbutton = document.createElement("button");

                newbutton.id = "KubeDown";
                newbutton.className = "u-button nd-file-list-toolbar-action-item u-button--primary";
                newbutton.style.marginRight = "8px";
                newbutton.innerText = "KubeDown";

                document.querySelector("div.wp-s-agile-tool-bar__header").prepend(newbutton);
            } else {
                setTimeout(() => {
                    AddElement();
                }, 100);
            }
        }

        document.getElementById("KubeDown").addEventListener("click", () => {
            let list = document.getElementsByClassName("wp-s-pan-table__body-row mouse-choose-item selected");
            if (list.length === 0) {
                list = document.getElementsByClassName("wp-s-file-grid-list__item text-center cursor-p mouse-choose-item is-checked");
                if (list.length === 0) {
                    list = document.getElementsByClassName("wp-s-file-contain-list__item text-center cursor-p mouse-choose-item is-checked");
                    if (list.length === 0) {
                        Swal.fire({
                            icon: "info",
                            title: "请选择一个文件",
                            confirmButtonText: "关闭",
                        });
                    }
                }
            }

            if (list.length === 1) {
                const fileid = list[0].getAttribute("data-id");

                if (fileid === "" || fileid === null) {
                    Swal.fire({
                        icon: "error",
                        title: "获取文件ID错误",
                        confirmButtonText: "关闭",
                    });

                    return;
                }

                Swal.fire({
                    title: "正在获取验证码",
                    allowOutsideClick: false,
                    didOpen: () => {
                        Swal.showLoading();

                        GM_xmlhttpRequest({
                            method: "POST",
                            // url: "http://127.0.0.1/getcaptcha.php",
                            url: "https://api.kubedown.com/getcaptcha.php",
                            data: new FormData().append("time", new Date().getTime()),
                            onload: function (response) {
                                const jsondata = JSON.parse(response.responseText);
                                const captchaid = jsondata["captchaid"];
                                const imagebase64 = jsondata["imagebase64"];

                                if (captchaid === "" || captchaid === undefined || imagebase64 === "" || imagebase64 === undefined) {
                                    Swal.fire({
                                        icon: "error",
                                        title: "数据异常",
                                        confirmButtonText: "关闭",
                                    });
                                } else {
                                    Swal.fire({
                                        title: "请输入以下图片验证码",
                                        input: "text",
                                        html: '<img src="' + imagebase64 + '" />',
                                        inputPlaceholder: "请输入验证码",
                                        showCancelButton: true,
                                        confirmButtonText: "验证",
                                        cancelButtonText: "关闭",
                                    }).then((result) => {
                                        if (result.isConfirmed) {
                                            Swal.fire({
                                                title: "text",
                                                title: "正在获取下载链接",
                                                allowOutsideClick: false,
                                                didOpen: () => {
                                                    Swal.showLoading();

                                                    GM_xmlhttpRequest({
                                                        method: "GET",
                                                        url: "https://pan.baidu.com/rest/2.0/xpan/multimedia?method=filemetas&dlink=1&fsids=[" + fileid + "]",
                                                        onload: (response) => {
                                                            const jsondata = JSON.parse(response.responseText);
                                                            const link = jsondata["list"][0]["dlink"];

                                                            if (link === "" || link === undefined) {
                                                                Swal.fire({
                                                                    Status: false,
                                                                    icon: "error",
                                                                    title: "获取下载地址错误",
                                                                    confirmButtonText: "关闭",
                                                                });
                                                            } else {
                                                                var formdata = new FormData();

                                                                formdata.append("captchaid", captchaid);
                                                                formdata.append("captchaanswer", result.value);

                                                                GM_xmlhttpRequest({
                                                                    method: "POST",
                                                                    // url: link.replace("d.pcs.baidu.com", "127.0.0.1").replace("https://", "http://"),
                                                                    url: link.replace("d.pcs.baidu.com", "api.kubedown.com").replace("http://", "https://"),
                                                                    data: formdata,
                                                                    onload: (response) => {
                                                                        console.log(response.responseText);

                                                                        const jsondata = JSON.parse(response.responseText);
                                                                        const status = jsondata["status"];
                                                                        const downloadlink = jsondata["downloadlink"];
                                                                        const useragent = jsondata["useragent"];

                                                                        if (status) {
                                                                            if (downloadlink === "" || downloadlink === undefined || useragent === "" || useragent === undefined) {
                                                                                Swal.fire({
                                                                                    icon: "error",
                                                                                    title: "数据异常",
                                                                                    confirmButtonText: "关闭",
                                                                                });
                                                                            } else {
                                                                                Swal.fire({
                                                                                    icon: "success",
                                                                                    title: "获取下载地址成功",
                                                                                    html: '<input id="swal-input1" class="swal2-input" value="' + downloadlink.replace("http://", "https://") + '"><input id="swal-input2" class="swal2-input" value="' + useragent + '">',
                                                                                });
                                                                            }
                                                                        } else {
                                                                            let error = jsondata["error"];

                                                                            if (error === "" || error === undefined) {
                                                                                error = "";
                                                                            }

                                                                            Swal.fire({
                                                                                icon: "error",
                                                                                title: "解析下载地址错误",
                                                                                text: error,
                                                                                confirmButtonText: "关闭",
                                                                            });
                                                                        }
                                                                    },
                                                                    onerror: () => {
                                                                        Swal.fire({
                                                                            icon: "error",
                                                                            title: "请求解析下载地址错误",
                                                                            confirmButtonText: "关闭",
                                                                        });
                                                                    },
                                                                });
                                                            }
                                                        },
                                                        onerror: () => {
                                                            Swal.fire({
                                                                icon: "error",
                                                                title: "请求生成下载地址错误",
                                                                confirmButtonText: "关闭",
                                                            });
                                                        },
                                                    });
                                                },
                                            });
                                        }
                                    });
                                }
                            },
                            onerror: () => {
                                Swal.fire({
                                    icon: "error",
                                    title: "请求获取验证码错误",
                                    text: "请检查是否关闭了代理!只允许中国IP访问!",
                                    confirmButtonText: "关闭",
                                });
                            },
                        });
                    },
                });
            }
        });
    })();
  • 五级用户 ma_er233 2023-4-19
    0 25
  • 四级用户 弈星 2023-4-19
    0 26
    被举报了
  • 四级用户 读书读坏脑 2023-4-19
    0 27
    ma_er233 // ==UserScript== // @name 百度网盘不限速下载-KubeDown // @description 百度网盘不限速下载-KubeDown-Script // @v ...
    谢谢
  • 四级用户 读书读坏脑 2023-4-19
    0 28
    点你这个和源码都能装上,回去就试试什么效果
  • 五级用户 立宝宝龙 2023-4-24
    0 29
    复活了,偷偷顶一下
  • 三级用户 1982 2023-5-30
    1 30
    我就想问了..到底是什么人..什么心态..哪个王八蛋举报的
  • 五级用户 立宝宝龙 2023-5-30
    0 31
    1982 我就想问了..到底是什么人..什么心态..哪个王八蛋举报的
    现在不是还可以用吗?也可能就是百度自己举报的??
    • 老男人游戏网配套论坛
      32
        立即登录 立即注册
发新帖
本论坛禁止发布SWITCH和PS4相关资源,若有其他侵权内容,请致邮3360342659#qq.com(#替换成@)删除。