// ==UserScript== // @name 2026最新可用-百度网盘SVIP高速解析直链的不限速下载助手-文武PanDownload (优化版) // @namespace https://github.com/dongyubin/Baidu-VIP // @version 8.18 // @description 2026年4月持续更新可用,不限制速度的百度网盘SVIP解析高速直链的脚本助手,无视黑号,100%可用,不限制文件大小,下载速度最快可达10M+/s,支持 Gopeed(一键解析)、IDM、NDM 等多线程极速下载工具,支持 Google Chrome、Microsoft Edge、Firefox 等浏览器。已优化按钮锁定和代码结构。 // @author dongyubin // @homepage https://shop.wangdu.site/buy/23 // @supportURL https://shop.wangdu.site/buy/23 // @license MIT // @icon https://fk.wangdu.site/uploads/images/6e798005b00ce678782af4e6931f4374.png // @resource layuiCSS https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.20/css/layui.min.css // @require https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.20/layui.min.js // @require https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js // @match *://pan.baidu.com/* // @match *://yun.baidu.com/* // @match *://pan.baidu.com/disk/home* // @match *://yun.baidu.com/disk/home* // @match *://pan.baidu.com/disk/timeline* // @match *://yun.baidu.com/disk/timeline* // @match *://pan.baidu.com/disk/main* // @match *://yun.baidu.com/disk/main* // @match *://pan.baidu.com/disk/base* // @match *://yun.baidu.com/disk/base* // @match *://pan.baidu.com/s/* // @match *://yun.baidu.com/s/* // @match *://pan.baidu.com/aipan/* // @match *://yun.baidu.com/aipan/* // @match *://pan.baidu.com/share/* // @match *://yun.baidu.com/share/* // @match *://openapi.baidu.com/* // @connect api.gssource.com // @connect baidu.com // @connect * // @connect 127.0.0.1 // @grant GM_cookie // @grant GM_addStyle // @grant GM_getResourceText // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @grant GM_notification // @grant GM_info // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @antifeature ads // @antifeature membership // @antifeature referral-link // @downloadURL none // ==/UserScript== (function () { 'use strict'; const layuiCss = GM_getResourceText('layuiCSS'); GM_addStyle(layuiCss + ` .layui-icon-close:before { content: "x" !important; } li { list-style: normal !important; } `); let randomNum = Math.floor(Math.random() * 9999); const wwConfig = { mainUrl: 'https://api.gssource.com', vipUrl: 'https://vipan.wangdu.site/login.php', bdPassword: '1234', titleName: '文武PanDownload', goPeedTaskUrl: 'http://127.0.0.1:9999/api/v1/tasks', one_parse: { code: `${randomNum}`, version: '1.0.9' }, wx_parse: { version: "1.0.9" }, gopeed: { name: 'GoPeed', url: 'https://pan.quark.cn/s/7babffa3960d' }, ndm: { name: 'NDM', url: 'https://neatdownloadmanager.com/index.php/en/' }, idm: { name: 'IDM', url: 'https://www.wangdu.site/software/tools/380.html' }, pandown: { month: 'https://fk.wwkejishe.top/buy/23', quarter: 'https://fk.wwkejishe.top/buy/24', halfYear: 'https://fk.wwkejishe.top/buy/25', year: 'https://fk.wwkejishe.top/buy/26', life: 'https://fk.wwkejishe.top/buy/27' }, liulanqi: { chrome: 'https://www.google.cn/intl/zh-CN/chrome/' }, monthCard: 'http://vip.jiufei.com/lin/GI5LG4?refer=1661', wechatCode: '验证码', debug_link: 'https://github.com/dongyubin/Baidu-VIP/issues', help_document: 'https://help.wwkejishe.top/baidu/baidu-wangpan-download', help_document_backup: 'https://wwkejishe.feishu.cn/wiki/XDY7w9XjSiGY5ZkuZxLcmxSCnYC?from=from_copylink' }; // 按钮锁定机制,防止并发提交 const downloadLock = { locked: false }; let gopeedMonitorHandle = null; // 可取消的监控句柄 // 按钮状态管理函数 function setButtonLoading(show = true) { const html = show ? '
正在发送中,请稍后...
' : '发送到Gopeed
'; $('#parseBtn, #parseWxBtn, #submitStableCaptcha').html(html); } function lockButtons() { downloadLock.locked = true; $('#parseBtn, #parseWxBtn, #submitStableCaptcha').prop('disabled', true); } function unlockButtons() { downloadLock.locked = false; $('#parseBtn, #parseWxBtn, #submitStableCaptcha').prop('disabled', false).html('发送到Gopeed
'); } // 免费解析配额管理(带时间戳验证) function getParseQuotaInfo() { const todayDate = new Date().toISOString().split('T')[0]; const stored = GM_getValue('pd_free_parse_quota', { date: todayDate, count: 0, lastTimestamp: 0 }); if (stored.date !== todayDate) { return { date: todayDate, count: 0, lastTimestamp: 0 }; } return stored; } function checkQuota(maxUsage = 2) { const now = Date.now(); const quota = getParseQuotaInfo(); // 时间戳验证:防止时间倒退或快速点击(最小间隔1秒) if (now < quota.lastTimestamp) { return { allowed: false, message: '检测到时间异常,请检查系统时间设置' }; } if (now - quota.lastTimestamp < 1000) { // 1秒内不允许重复 return { allowed: false, message: '操作过于频繁,请稍后再试' }; } if (quota.count >= maxUsage) { return { allowed: false, message: `今日免费解析已达上限(最多${maxUsage}次),明天再来!` }; } return { allowed: true, remaining: maxUsage - quota.count }; } function increaseQuota() { const now = Date.now(); const quota = getParseQuotaInfo(); quota.count++; quota.lastTimestamp = now; GM_setValue('pd_free_parse_quota', quota); } // 重构的下载链接获取函数,消除重复代码 function getDownloadLink(requestData, downloadUrl) { const headers = { 'Content-Type': 'application/json' }; if (wwConfig.token) { headers['Authorization'] = 'Bearer ' + wwConfig.token; } return new Promise((resolve, reject) => { GM_xmlhttpRequest({ method: 'POST', url: downloadUrl, headers: headers, data: JSON.stringify(requestData), onload: (resp) => { try { resolve(JSON.parse(resp.responseText)); } catch (e) { reject(new Error('解析响应失败')); } }, onerror: reject }); }); } // 启动Gopeed监控 function startGopeedMonitor() { gopeedMonitorHandle = setInterval(() => { GM_xmlhttpRequest({ method: 'get', url: wwConfig.goPeedTaskUrl + '?status=running', headers: { 'Content-Type': 'application/json', }, onload: function (response) { try { const responseData = JSON.parse(response.responseText); const result = responseData.data.filter(e => e.status === "running" ).filter((e) => e.progress.speed < 1048576).map(e => e.id); const ids = result.map((e) => { return `id=${e}` }).join('&') if (ids && ids.length) { GM_xmlhttpRequest({ method: 'put', url: `${wwConfig.goPeedTaskUrl}/pause?${ids}`, headers: { 'Content-Type': 'application/json', }, onload: function (response) { GM_xmlhttpRequest({ method: 'put', url: `${wwConfig.goPeedTaskUrl}/continue?${ids}`, headers: { 'Content-Type': 'application/json', }, onload: function (response) { } }) } }) } } catch (e) { // 静默处理监控错误 } } }) }, 15000); } // 停止Gopeed监控 function stopGopeedMonitor() { if (gopeedMonitorHandle) { clearInterval(gopeedMonitorHandle); gopeedMonitorHandle = null; } } const danger_info = `部分校园网可能不支持解析。如遇问题,请先切换网络或使用下方方法。
插件解析免费 2 次
${(function() { const quota = getParseQuotaInfo(); const remaining = Math.max(0, 2 - quota.count); return `今日已用: ${quota.count} 次,还剩: ${remaining} 次
`; })()}(提示:解析次数已达上限,代表失效,静等更新。)
如果失效,请使用验证码解析
`+ danger_info + `
免费不易,获取验证码需要看广告,希望理解。
常见问题文档: 点击查看常见问题(能够解决80%的问题)
好用的话,请给个好评,带上截图就更好了!点击前往
有问题请带图反馈,我会尽快修复!
1、Edge 浏览器 一直显示解析中 / 无法发送到gopeed / 多次提示:验证码错误
答:尝试使用 Google Chrome 浏览器
2、 提示:免费次数已用完
答:请明天再试,第二天重置次数
3、 无法获取验证码
答:切换网络试试
正在发送中,请稍后...
'); // let testDown = await testSendToGopeed(); // if (!testDown) { // layer.close(openInfoLayer); // gospeedDownload(); // $('#parseWxBtn').html('发送到Gopeed
'); // return; // } let one_url = wwConfig.mainUrl + '/wp/getPcCodeNum'; // if (wwConfig.token) { // share_one_baidu(openInfoLayer, one_url, captchaStr, wwConfig.wx_parse.version, 3); // } else { // let uuid = GM_getValue('captcha_uuid'); GM_xmlhttpRequest({ method: 'POST', url: `${wwConfig.vipUrl}`, headers: { 'Content-Type': 'application/json', }, // data: JSON.stringify({ // code: code, // uuid: uuid // }), onload: function (response) { // console.log(response); const data = JSON.parse(response.responseText); if (data.status === 'success') { wwConfig.token = data.token; // $('#captchaContainer').html(``); share_one_baidu(openInfoLayer, one_url, captchaStr, wwConfig.wx_parse.version, 3); } else { unlockButtons(); layer.msg(data.message); // loadStableCaptcha(); } } }); // } } else { layer.msg('请输入验证码'); } }) }, end: function() { // 模态框关闭时停止监控 stopGopeedMonitor(); } }); }); }); function gospeedDownload() { swal({ title: "下载 Gopeed 加速器", text: '请先安装 Gopeed 并打开运行(点击按钮下载 Gopeed)。', icon: 'warning', type: "warning", confirmButtonText: '点击下载Gopeed', confirmButtonColor: "#dd6b55", }).then(function () { openUrl('https://pan.quark.cn/s/7babffa3960d'); }); } function openUrl(url) { window.open(url); } function selectList() { var select = {}; var option = []; try { option = require('system-core:context/context.js').instanceForSystem.list.getSelected(); } catch (e) { option = document.querySelector('.wp-s-core-pan').__vue__.selectedList; } option.forEach((element) => { select[element.fs_id] = element; }); return select; } function init_parse(code) { switch (code) { case 1: layer.msg('解析中', { icon: 6, time: 3000, }); setTimeout(() => { unlockButtons(); layer.alert('解析通道比较拥堵,请尝试快速下载!', { title: '提示', closeBtn: 0, btn: ['确定', '前往快速下载'], btn1: function (index) { layer.close(index); }, btn2: function (index) { openUrl(wwConfig.monthCard); } }); }, 3000); break; case 2: layer.alert( '验证码错误,一个验证码只能下载一个文件,请重新获取!', { title: '提示', closeBtn: 0 }, function (index) { unlockButtons(); layer.close(index); } ); break; case 3: layer.alert('今日下载次数已达上限,请明天再来下载,或者使用快速下载!', { title: '提示', closeBtn: 0, btn: ['确定', '前往快速下载'], btn1: function (index) { unlockButtons(); layer.close(index); }, btn2: function (index) { openUrl(wwConfig.monthCard); } }); break; case 4: layer.alert('解析失败,请升级插件或者使用网页稳定版地址!', { title: '提示', closeBtn: 0, btn: ['确定', '前往快速下载'], btn1: function (index) { unlockButtons(); layer.close(index); }, btn2: function (index) { openUrl(wwConfig.monthCard); } }); break; case 5: layer.alert('文件大于 3G,插件暂不支持下载,请使用网页稳定版地址(不限制文件大小)!', { title: '提示', closeBtn: 0, btn: ['前往快速下载'], btn1: function (index) { openUrl(wwConfig.monthCard); layer.close(index); } }); break; default: wwConfig.one_parse.version = 1; break; } } function share_one_baidu(openInfoLayer, url, code, version, type) { // console.log(openInfoLayer, url, code, version, type); let select = Object.keys(selectList()); let bdstoken = ''; let data_json = {}; try { data_json = $('html') .html() .match(/(?<=locals\.mset\()(.*?)(?=\);)/)[0]; data_json = JSON.parse(data_json); wwConfig.username = data_json.username; bdstoken = data_json.bdstoken; } catch (e) { data_json = $('html') .html() .match(/(?<=window\.locals\s=\s)(.*?)(?=;)/)[0]; data_json = JSON.parse(data_json); wwConfig.username = data_json.userInfo.username; bdstoken = data_json.userInfo.bdstoken; } wwConfig.data_json = data_json; $.ajax({ type: 'GET', url: 'https://pan.baidu.com/share/set', async: true, data: { bdstoken: bdstoken, period: 1, pwd: wwConfig.bdPassword, eflag_disable: true, channel_list: '%5B%5D', schannel: 4, fid_list: JSON.stringify(select), }, dataType: 'json', success: function (res) { if (res.show_msg.indexOf('禁止') > -1) { unlockButtons(); swal({ text: '该文件禁止分享', icon: 'error', }); return false; } else { let shorturl = ''; try { shorturl = res.link.split('/').pop(); } catch (error) { unlockButtons(); swal({ text: '初始化准备失败', icon: 'error', }); return false; } fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ code: code, userKey: 'main', fsId: select[0], version: version, }), }) .then((resp) => resp.json()) .then((res) => { let laysermsg = layer.msg('正在解析中', { icon: 6, time: 10000, }); if (res.code == 200) { if ((res.data > 100) || (res.data.data == 100 & res.data.vip == 0) || (res.data.data == 100 & res.data.vip == 1) || (res.data == 50 || res.data.data == 50)) { let download_url = ''; switch (type) { case 1: download_url = wwConfig.mainUrl + '/wp/pc/dlink'; break; case 2: download_url = wwConfig.mainUrl + '/wp/fast/pc/dlink'; break; case 3: download_url = wwConfig.mainUrl + '/wp/fast/pc/dlink'; break; } get_down_list( shorturl, wwConfig.bdPassword, openInfoLayer, res.data, laysermsg, download_url, type ); } else if (res.data == 80 || res.data.data == 80) { init_parse(1); } else if (res.data == 60 || res.data.data == 60) { init_parse(3); } // else if (res.data == 50 || res.data.data == 50) { // init_parse(2); // } else if (res.data.data == 100 || res.data.vip == 0) { init_parse(3); } else { init_parse(2); } } else if (res.code == 500) { layer.close(openInfoLayer); layer.close(laysermsg); unlockButtons(); init_parse(3); } }); } }, error: function (res) { unlockButtons(); swal({ text: '初始化准备请求访问失败', icon: 'error', }); }, }); } function copy_text(text, msg) { navigator.clipboard.writeText(text).then(() => { layer.msg(msg + ' 已复制到剪贴板'); }).catch(err => { layer.msg('复制失败,请手动复制:' + text); }); } async function get_down_list(shorturl, password, openInfoLayer, pwd, laysermsg, downloadUrl, type) { // console.log(shorturl, password, openInfoLayer, pwd, laysermsg, downloadUrl, type); let ajax_data = { shorturl: shorturl, pwd: password, dir: 1, root: 1, userKey: 'main', }; if (type == 3) { // ajax_data.dir = "1"; // ajax_data.index = 0; // ajax_data.root = "1"; password = 'ymta'; } fetch(wwConfig.mainUrl + '/wp/parseCopyLink', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(ajax_data), }) .then((resp) => resp.json()) .then(async (res) => { if (res.code == 200) { // const size = parseInt(res.data.data.list[0].size); // if (size > 3221225472) { // layer.close(openInfoLayer); // layer.close(laysermsg); // $('#parseBtn').html('发送到Gopeed
'); // init_parse(5); // return false; // } const requestData = { fsId: res.data.data.list[0].fs_id, shareid: res.data.data.shareid, uk: res.data.data.uk, sekey: res.data.data.seckey, randsk: res.data.data.seckey, fs_ids: [res.data.data.list[0].fs_id], path: res.data.data.list[0].server_filename, size: res.data.data.list[0].size, surl: shorturl, url: `https://pan.baidu.com/s/${shorturl}`, userKey: 'main', pwd: password, dir: '/', }; try { const responseData = await getDownloadLink(requestData, downloadUrl); if (responseData.code !== 200) { layer.close(openInfoLayer); layer.close(laysermsg); unlockButtons(); init_parse(3); } else { layer.close(laysermsg); if (responseData.data.vip) { wwConfig.url = responseData.data.data.dlink; wwConfig.ua = responseData.data.data.ua; } else { wwConfig.url = responseData.data.dlink; wwConfig.ua = responseData.data.ua; } sendToGopeed(responseData.data.data || responseData.data, res.data.data.list[0].server_filename); } } catch (error) { layer.close(openInfoLayer); layer.close(laysermsg); unlockButtons(); const errorMessage = error.message || '网络错误'; swal({ text: '发送到Gopeed遇到问题了,请刷新重试!!', icon: 'warning', }); } } else { layer.close(openInfoLayer); layer.close(laysermsg); unlockButtons(); $('#parseBtn').html('发送到Gopeed
'); $('#parseWxBtn').html('发送到Gopeed
'); swal({ text: '发送到Gopeed遇到问题了,请升级插件刷新重试!!', icon: 'warning', }); } }); } function testSendToGopeed() { return fetch(wwConfig.goPeedTaskUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, }) .then((resp) => resp.json()) .then((res) => { return true; }).catch(e => { return false; }) } function sendToGopeed(item, fileName) { // console.log(item, fileName) let download_url = item.url? item.url: item.urls[0].url; let download_ua = wwConfig.ua? wwConfig.ua: item.ua; let data = { req: { url: download_url, extra: { header: { "User-Agent": download_ua, } } }, opt: { extra: { connections: 256, } } } fetch(wwConfig.goPeedTaskUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(data), }).then((resp) => resp.json()) .then((res) => { unlockButtons(); increaseQuota(); // 成功发送后增加配额计数 startGopeedMonitor(); // 启动监控 layer.open({ content: `请打开 Gopeed 查看 ${fileName} 是否开始下载?未下载成功,先设置IDM/NDM User-Agent:\`${wwConfig.ua}\`,再复制直链下载!`,
btn: ['已下载,关闭弹窗', '复制UA', '未下载,复制直链'],
// content: `请打开 Gopeed 查看 ${fileName} 是否开始下载?未下载成功,请重试!(暂时只支持 Gopeed 下载!)`,
// btn: ['已下载,关闭弹窗', '未下载,复制直链'],
closeBtn: 0,
type: 1,
btn1: function (index, layero, that) {
layer.close(index);
},
btn2: function (index, layero, that) {
GM_setClipboard(wwConfig.ua, "text");
layer.msg('UA复制成功!');
return false;
},
btn3: function (index, layero, that) {
GM_setClipboard(download_url, "text");
layer.msg(`${fileName} 的直链复制成功!`);
return false;
}
});
}).catch(e => {
unlockButtons();
layer.msg('发送到Gopeed失败: ' + (e.message || '网络错误'));
})
}
// function loadStableCaptcha() {
// GM_xmlhttpRequest({
// method: 'GET',
// url: `${wwConfig.vipUrl}`,
// onload: function (response) {
// console.log(response.responseText);
// const data = JSON.parse(response.responseText);
// if (data.status === 'success') {
// $('#captchaImage').attr('src', 'data:image/jpeg;base64,' + data.img);
// GM_setValue('captcha_uuid', data.uuid);
// }
// }
// });
// }
// 启动监控(在sendToGopeed成功后调用)
// startGopeedMonitor();
})();