2025最新可用-百度网盘SVIP高速解析直链的不限速下载助手-文武PanDownload

2025年持续更新可用,不限制速度的百度网盘SVIP解析高速直链的脚本助手,无视黑号,100%可用,不限制文件大小,下载速度最快可达10M+/s,支持 Gopeed(一键解析)、IDM、NDM 等多线程极速下载工具,支持 Microsoft Edge、Google Chrome、Firefox 等浏览器。

目前为 2025-01-10 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 2025最新可用-百度网盘SVIP高速解析直链的不限速下载助手-文武PanDownload
  3. // @namespace https://github.com/dongyubin/Baidu-VIP
  4. // @version 6.0
  5. // @description 2025年持续更新可用,不限制速度的百度网盘SVIP解析高速直链的脚本助手,无视黑号,100%可用,不限制文件大小,下载速度最快可达10M+/s,支持 Gopeed(一键解析)、IDM、NDM 等多线程极速下载工具,支持 Microsoft Edge、Google Chrome、Firefox 等浏览器。
  6. // @author dongyubin
  7. // @homepage https://fk.wwkejishe.top/buy/23
  8. // @supportURL https://fk.wwkejishe.top/buy/23
  9. // @license MIT
  10. // @icon https://fk.wwkejishe.top/uploads/images/6e798005b00ce678782af4e6931f4374.png
  11. // @resource layuiCSS https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.20/css/layui.min.css
  12. // @require https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.20/layui.min.js
  13. // @require https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js
  14. // @match *://pan.baidu.com/*
  15. // @match *://yun.baidu.com/*
  16. // @match *://pan.baidu.com/disk/home*
  17. // @match *://yun.baidu.com/disk/home*
  18. // @match *://pan.baidu.com/disk/timeline*
  19. // @match *://yun.baidu.com/disk/timeline*
  20. // @match *://pan.baidu.com/disk/main*
  21. // @match *://yun.baidu.com/disk/main*
  22. // @match *://pan.baidu.com/disk/base*
  23. // @match *://yun.baidu.com/disk/base*
  24. // @match *://pan.baidu.com/s/*
  25. // @match *://yun.baidu.com/s/*
  26. // @match *://pan.baidu.com/aipan/*
  27. // @match *://yun.baidu.com/aipan/*
  28. // @match *://pan.baidu.com/share/*
  29. // @match *://yun.baidu.com/share/*
  30. // @match *://openapi.baidu.com/*
  31. // @connect api.aifenxiang.net.cn
  32. // @connect baidu.com
  33. // @connect *
  34. // @connect 127.0.0.1
  35. // @grant GM_cookie
  36. // @grant GM_addStyle
  37. // @grant GM_getResourceText
  38. // @grant GM_xmlhttpRequest
  39. // @grant GM_setClipboard
  40. // @grant GM_notification
  41. // @grant GM_info
  42. // @antifeature ads
  43. // @antifeature membership
  44. // @antifeature referral-link
  45. // ==/UserScript==
  46. (function () {
  47. 'use strict';
  48. const layuiCss = GM_getResourceText('layuiCSS');
  49. GM_addStyle(layuiCss + `
  50. .layui-icon-close:before {
  51. content: "x" !important;
  52. }
  53. li {
  54. list-style: normal !important;
  55. }
  56. `);
  57. const wwConfig = {
  58. mainUrl: 'https://api.aifenxiang.net.cn',
  59. bdPassword: '1234',
  60. titleName: '文武PanDownload',
  61. goPeedTaskUrl: 'http://127.0.0.1:9999/api/v1/tasks',
  62. one_parse: {
  63. code: '1.0.6',
  64. version: '1.1.4'
  65. },
  66. wx_parse: {
  67. version: "1.0.9"
  68. },
  69. gopeed: {
  70. name: 'GoPeed',
  71. url: 'https://pan.quark.cn/s/0b2e9c6e94b0'
  72. },
  73. ndm: {
  74. name: 'NDM',
  75. url: 'https://neatdownloadmanager.com/index.php/en/'
  76. },
  77. idm: {
  78. name: 'IDM',
  79. url: 'https://www.wangdu.site/software/tools/380.html'
  80. },
  81. monthCard: 'https://fk.wwkejishe.top/buy/23',
  82. wechatCode: '验证码',
  83. debug_link: 'https://github.com/dongyubin/Baidu-VIP/issues',
  84. authorWechat: 'dyb54188'
  85. };
  86. layui.use(['layer'], async function () {
  87. var layer = layui.layer,
  88. $ = layui.$;
  89. var form = layui.form;
  90. if (location.href.startsWith('https://pan.baidu.com/s/')) {
  91. $('.x-button-box').prepend(
  92. '<a class="g-button" id="downbtn_share" style="background-color: #6800ff;color: #fff;border:none;" href="javascript:;" ><span class="g-button-right"><em style="top:0;" class="icon icon-download" title=""></em><lable class="text" style="width: auto;">' +
  93. wwConfig.titleName +
  94. '</lable></span></a>'
  95. );
  96. } else {
  97. if ($('.tcuLAu').is('*')) {
  98. $('.tcuLAu').prepend(
  99. '<span class="g-dropdown-button"><a id="downbtn_main" style=" margin-right: 10px;color: #fff;background-color: #fc5531;border:none;" id="downbtn_main" class="g-button" ><span class="g-button-right"><em style="top:0;" class="icon icon-download" ></em><lable class="text" style="width: auto;">' +
  100. wwConfig.titleName +
  101. '</lable></span></a></span>'
  102. );
  103. } else {
  104. $('.wp-s-agile-tool-bar__header.is-header-tool').prepend(
  105. '<div class="wp-s-agile-tool-bar__h-group"><button style=" margin-right: 10px;color: #fff;background-color: #ff436a;border:none;" id="downbtn_main" class="u-button nd-file-list-toolbar-action-item" ><i style="top:0;" class="iconfont icon-download"></i> <lable>' +
  106. wwConfig.titleName +
  107. '</lable></button></div>'
  108. );
  109. }
  110. }
  111. $('#downbtn_share').click(function () {
  112. swal({
  113. title: '提示',
  114. text: '请先保存到自己的网盘后,在网盘里解析下载!',
  115. icon: 'warning',
  116. });
  117. return false;
  118. });
  119. $('#downbtn_main').click(function () {
  120. let select = selectList();
  121. let selected = Object.keys(select);
  122. if (selected.length == 0) {
  123. swal({
  124. text: '请先选择一个文件',
  125. icon: 'warning',
  126. });
  127. return false;
  128. } else if (selected.length > 1) {
  129. swal({
  130. text: '目前仅支持单个文件解析',
  131. icon: 'warning',
  132. });
  133. return false;
  134. } else if (select[selected[0]].isdir == 1) {
  135. swal({
  136. text: '目前不支持文件夹解析',
  137. icon: 'warning',
  138. });
  139. return false;
  140. }
  141.  
  142. const openInfoLayer = layer.open({
  143. type: 1,
  144. area: ['550px', 'auto'],
  145. title: '提示',
  146. type: 1,
  147. shade: 0.6,
  148. shadeClose: true,
  149. anim: 0,
  150. content: `
  151. <div class="layui-tab layui-tab-brief" style="background-color: #f8f8f8; border-radius: 8px;">
  152. <ul class="layui-tab-title" style="background-color: #fff; border-bottom: 1px solid #e6e6e6;">
  153. <!-- <li class="layui-this">免费解析</li> -->
  154. <li class="layui-this">验证码解析</li>
  155. <li>稳定解析</li>
  156. <li>防止失联</li>
  157. <li>问题反馈</li>
  158. </ul>
  159. <div class="layui-tab-content" style="padding: 20px;">
  160. <!--
  161. <div class="layui-tab-item layui-show">
  162. <div class="layui-form" lay-filter="filter-test-layer"
  163. style="width:360px;margin: 16px auto 0; background-color: #fff; border-radius: 8px; padding: 20px;">
  164. <div class="demo-send-container">
  165. <div>
  166. <p style="font-weight:900; text-align: center;">请更新到最新版本再使用</p>
  167. <p>插件解析限制 <span class="piao">2</span> 次</p>
  168. <p style="font-weight:900;">
  169. ⚠️❗ 一定要先配置好 <a href="`+ wwConfig.gopeed.url + `" target="_blank" style="font-weight: 900;color: #409eff;">` + wwConfig.gopeed.name + `</a> 下载器的 User-Agent、端口、连接数: <a style="color:red;" target="_blank"
  170. href="https://flowus.cn/share/c68e3c55-67e5-460f-b937-7727e0378a34?code=BCRWJL">点击查看 Gopeed 配置教程说明</a>
  171. </p>
  172. <p>
  173. 不限次数 PC 网页稳定版(<a href='`+ wwConfig.monthCard + `' target='_blank'
  174. style='color: #007bff; text-decoration: none;'>购买月卡登录</a>):
  175. <a style="color:red;font-weight:900;" target="_blank"
  176. href="https://pandown.mlover.site/">点击前往</a>
  177. </p>
  178. <p>
  179. 部分校园网可能不支持解析
  180. </p>
  181. </div>
  182. <div class="layui-btn-container">
  183. <button style="margin-top:30px; border-radius: 8px;" id="gopeedSetBtn"
  184. class="layui-btn layui-btn-fluid layui-bg-red" lay-submit lay-filter="gopeed-set">1️⃣
  185. Gopeed设置教程</button>
  186. <button style="margin-top:10px; border-radius: 8px;" id="copyUaBtn"
  187. class="layui-btn layui-btn-fluid layui-bg-orange" lay-submit lay-filter="copy-ua">2️⃣
  188. 复制User-Agent</button>
  189. <button style="margin-left:0;margin-top:10px; border-radius: 8px;" id="parseBtn"
  190. class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-send">2️⃣ 发送到Gopeed</button>
  191. </div>
  192. </div>
  193. </div>
  194. </div>
  195. -->
  196. <div class="layui-tab-item layui-show" style="background-color: #fff; border-radius: 8px; padding: 20px;text-align: center;">
  197. <p style="font-weight:900; text-align: center;">请更新到最新版本再使用</p>
  198. <p style="font-weight:900;">
  199. ⚠️❗ 一定要先配置好 <a href="`+ wwConfig.gopeed.url + `" target="_blank" style="font-weight: 900;color: #409eff;">` + wwConfig.gopeed.name + `</a> 下载器的 User-Agent、端口、连接数: <a style="color:red;" target="_blank"
  200. href="https://flowus.cn/share/c68e3c55-67e5-460f-b937-7727e0378a34?code=BCRWJL">点击查看 Gopeed 配置教程说明</a>
  201. </p>
  202. <p>
  203. 不限次数 PC 网页稳定版(<a href='`+ wwConfig.monthCard + `' target='_blank'
  204. style='color: #007bff; text-decoration: none;'>购买月卡登录</a>):
  205. <a style="color:red;font-weight:900;" target="_blank"
  206. href="https://pandown.mlover.site/">点击前往</a>
  207. </p>
  208. <p>
  209. 部分校园网可能不支持解析
  210. </p>
  211. <div>
  212. <img src="https://cdn.wwkejishe.top/wp-cdn-02/2024/202411171346351.webp" style="width:200px;height:200px;">
  213. </div>
  214. <h2 class="h2" style="margin-top: 10px;">获取验证码:扫描二维码,复制下面口令并发送</h2>
  215. <div>每天随机解析5-10次(<a style="color: red;font-weight:900;" target="_blank"
  216. href="https://www.wangdu.site/software/tools/948.html">无限制获取验证码</a>)
  217. </div>
  218. <div>
  219. <input type="text" name="captcha" id="captcha" value="" lay-verify="required" placeholder="请填写验证码"
  220. lay-reqtext="请填写验证码" autocomplete="off" class="layui-input" lay-affix="clear">
  221. </div>
  222. <button style="margin-top:30px; border-radius: 8px;" id="copyWechatBtn"
  223. class="layui-btn layui-btn-fluid layui-bg-red" lay-submit lay-filter="gopeed-set">1️⃣
  224. 复制微信口令</button>
  225. <button style="margin-left:0;margin-top:10px; border-radius: 8px;" id="parseWxBtn"
  226. class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-wx-send">2️⃣ 发送到Gopeed</button>
  227. </div>
  228. <div class="layui-tab-item" style="background-color: #fff; border-radius: 8px; padding: 20px;">
  229. <p><span style="font-weight: 900;">`+ GM_info.script.name + `</span> 最新的脚本版本号为:<span style="font-weight: 900;">`
  230. + GM_info.script.version + `</span></p>
  231. <p>&nbsp;</p>
  232. <p>
  233. <a href="`+ wwConfig.monthCard + `" target="_blank" style="font-weight: 900;color: #409eff;">
  234. 购买月卡:不限次数、不限制文件大小、不限速、批量下载</a>(搭配<a href="https://greasyfork.org/zh-CN/scripts/521641" target="_blank" style="font-weight: 900;color: #409eff;">油猴脚本</a>在解析时可获取网盘直链,使用<a href="`+ wwConfig.ndm.url + `" target="_blank" style="font-weight: 900;color: #409eff;">` + wwConfig.ndm.name + `</a>、<a href="` + wwConfig.idm.url + `" target="_blank" style="font-weight: 900;color: #409eff;">` + wwConfig.idm.name + `</a>下载)
  235. </p>
  236. <p>
  237. <p>&nbsp;</p>
  238. <figure class='table-figure'>
  239. <table class="layui-table" style="border-collapse: separate;">
  240. <thead>
  241. <tr>
  242. <th style="background-color: #f8f8f8; border-bottom: 2px solid #e6e6e6; padding: 10px;">百度VIP</th>
  243. <th style="background-color: #f8f8f8; border-bottom: 2px solid #e6e6e6; padding: 10px;">百度SVIP</th>
  244. <th style="background-color: #f8f8f8; border-bottom: 2px solid #e6e6e6; padding: 10px;">
  245. <a href='`+ wwConfig.monthCard + `' target='_blank'
  246. style='color: #007bff; text-decoration: none;'>Pandownload月卡</a>
  247. </th>
  248. </tr>
  249. </thead>
  250. <tbody>
  251. <tr>
  252. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">¥25/月</td>
  253. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">¥40/月</td>
  254. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;color: rgba(5,150,105,1)">¥9/月</td>
  255. </tr>
  256. <tr>
  257. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">20G/月</td>
  258. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">不限制</td>
  259. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;color: rgba(5,150,105,1)">
  260. 不限制文件大小、不限制文件数量、批量高速下载</td>
  261. </tr>
  262. </tbody>
  263. </table>
  264. </figure>
  265. <p>&nbsp;</p>
  266. <div>
  267. <ul>
  268. <li>
  269. <a href="http://vip.jiufei.com/lin/GI5LG4?refer=1661" target="_blank"
  270. style="color: #007bff; text-decoration: none;">点击购买(高质量)网盘会员</a>:¥3/4天,¥7.5/25天,¥22.8/年
  271. </li>
  272. <li>点击购买百度网盘SVIP会员:
  273. <a href="https://snsyun.baidu.com/sl/hqJOZTa" target="_blank"
  274. style="color: #007bff; text-decoration: none;">(官方月卡)</a>、
  275. <a href="https://snsyun.baidu.com/sl/dDHTo7R" target="_blank"
  276. style="color: #007bff; text-decoration: none;">(官方季卡)</a>、
  277. <a href="https://snsyun.baidu.com/sl/eQI7jEU" target="_blank"
  278. style="color: #007bff; text-decoration: none;">(官方年卡)</a>
  279. </li>
  280. </ul>
  281. </div>
  282. <p>&nbsp;</p>
  283. <p>2023-2024 © Github By <a style="color:#007bff;" href="https://github.com/dongyubin/Baidu-VIP"
  284. target="_blank">@dongyubin</a></p>
  285. </div>
  286. <div class="layui-tab-item" style="background-color: #fff; border-radius: 8px; padding: 20px;text-align: center;">
  287. <div>
  288. <img src="https://cdn.wwkejishe.top/wp-cdn-02/2024/202411171346351.webp" style="width:240px;height:240px;">
  289. </div>
  290. <h2 class="h2" style="margin-top: 10px;">扫一扫,不失联</h2>
  291. <h3 class="h2" style="margin-top: 10px;">众所周知,脚本不可能每时每刻都能用。关注不迷路 ~</h3>
  292. </div>
  293. <div class="layui-tab-item" style="background-color: #fff; border-radius: 8px; padding: 20px;">
  294. <p>
  295. 好用的话,请给个好评,带上截图就更好了!<a href="https://greasyfork.org/zh-CN/scripts/518023-%E7%99%BE%E5%BA%A6%E7%BD%91%E7%9B%98svip%E9%AB%98%E9%80%9F%E8%A7%A3%E6%9E%90%E7%9B%B4%E9%93%BE%E7%9A%84%E4%B8%8D%E9%99%90%E9%80%9F%E4%B8%8B%E8%BD%BD%E5%8A%A9%E6%89%8B-%E6%96%87%E6%AD%A6pandownload/feedback" target="_blank" style="color: #007bff; text-decoration: none;">点击前往</a>
  296. </p>
  297. <p>
  298. 有问题请带图反馈,我会尽快修复!
  299. </p>
  300. <div class="layui-btn-container">
  301. <button style="margin-top:10px; border-radius: 8px;" id="goIssues"
  302. class="layui-btn layui-btn-fluid layui-bg-red" lay-submit lay-filter="gopeed-set">点击前往提交issues</button>
  303. <button style="margin-top:10px; border-radius: 8px;" id="copyAuthorWechat"
  304. class="layui-btn layui-btn-fluid" lay-submit lay-filter="gopeed-set">
  305. 点击复制作者微信号</button>
  306. </div>
  307. </div>
  308. </div>
  309. </div>
  310. `,
  311. success: function () {
  312. // 对弹层中的表单进行初始化渲染
  313. form.render();
  314. // 表单提交事件
  315. form.on('submit(demo-send)', async function (data) {
  316. $('#parseBtn').html('<p>正在发送中,请稍后...</p>');
  317. let testDown = await testSendToGopeed();
  318. if (!testDown) {
  319. layer.close(openInfoLayer);
  320. gospeedDownload();
  321. $('#parseBtn').html('<p>发送到Gopeed</p>');
  322. return;
  323. }
  324. let one_url = wwConfig.mainUrl + '/wp/getCodeNum';
  325. share_one_baidu(openInfoLayer, one_url, wwConfig.one_parse.code, wwConfig.one_parse.version, 1);
  326. });
  327.  
  328. $('#parseWxBtn').on('click', async function () {
  329. let captchaStr = $('#captcha').val();
  330. if (captchaStr) {
  331. $('#parseWxBtn').html('<p>正在发送中,请稍后...</p>');
  332. let testDown = await testSendToGopeed();
  333. if (!testDown) {
  334. layer.close(openInfoLayer);
  335. gospeedDownload();
  336. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  337. return;
  338. }
  339. let one_url = wwConfig.mainUrl + '/wp/getPcCodeNum';
  340. share_one_baidu(openInfoLayer, one_url, captchaStr, wwConfig.wx_parse.version, 2);
  341. } else {
  342. layer.msg('请输入验证码');
  343. }
  344.  
  345. });
  346.  
  347. // 复制 User-Agent 按钮的事件处理
  348. $('#copyUaBtn').on('click', function () {
  349. copy_text(wwConfig.ua, 'User-Agent');
  350. });
  351. $('#copyWechatBtn').on('click', function () {
  352. copy_text(wwConfig.wechatCode, '微信口令');
  353. })
  354. $('#gopeedSetBtn').on('click', function () {
  355. openUrl('https://flowus.cn/share/c68e3c55-67e5-460f-b937-7727e0378a34?code=BCRWJL');
  356. })
  357. $('#goIssues').on('click', function () {
  358. openUrl(wwConfig.debug_link);
  359. })
  360. $('#copyAuthorWechat').on('click', function () {
  361. copy_text(wwConfig.authorWechat, '作者微信');
  362. })
  363. },
  364. });
  365. });
  366. });
  367.  
  368. function gospeedDownload() {
  369. swal({
  370. title: "下载 Gopeed 加速器",
  371. text: '请先安装 Gopeed 并打开运行(点击按钮下载 Gopeed)。',
  372. icon: 'warning',
  373. type: "warning",
  374. confirmButtonText: '点击下载Gopeed',
  375. confirmButtonColor: "#dd6b55",
  376. }).then(function () {
  377. openUrl('https://pan.quark.cn/s/0b2e9c6e94b0');
  378. });
  379. }
  380.  
  381. function openUrl(url) {
  382. window.open(url);
  383. }
  384.  
  385. function selectList() {
  386. var select = {};
  387. var option = [];
  388.  
  389. try {
  390. option =
  391. require('system-core:context/context.js').instanceForSystem.list.getSelected();
  392. } catch (e) {
  393. option = document.querySelector('.wp-s-core-pan').__vue__.selectedList;
  394. }
  395. option.forEach((element) => {
  396. select[element.fs_id] = element;
  397. });
  398. return select;
  399. }
  400.  
  401. function init_parse(code) {
  402. switch (code) {
  403. case 1:
  404. layer.msg('解析中', {
  405. icon: 6,
  406. time: 3000,
  407. });
  408. setTimeout(() => {
  409. $('#parseBtn').html('<p>发送到Gopeed</p>');
  410. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  411. layer.alert('解析通道比较拥堵,请尝试快速下载!', {
  412. title: '提示',
  413. closeBtn: 0,
  414. btn: ['确定', '前往快速下载'],
  415. btn1: function (index) {
  416. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  417. layer.close(index);
  418. },
  419. btn2: function (index) {
  420. openUrl(wwConfig.monthCard);
  421. }
  422. });
  423. }, 3000);
  424. break;
  425. case 2:
  426. layer.alert(
  427. '验证码错误,一个验证码只能下载一个文件,请重新获取!',
  428. {
  429. title: '提示',
  430. closeBtn: 0
  431. }, function (index) {
  432. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  433. layer.close(index);
  434. }
  435. );
  436. break;
  437. case 3:
  438. layer.alert('今日下载次数已达上线,请明天再来下载,或者使用快速下载!', {
  439. title: '提示',
  440. closeBtn: 0,
  441. btn: ['确定', '前往快速下载'],
  442. btn1: function (index) {
  443. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  444. layer.close(index);
  445. },
  446. btn2: function (index) {
  447. openUrl(wwConfig.monthCard);
  448. }
  449. });
  450. break;
  451. case 4:
  452. layer.alert('解析失败,请升级插件或者使用网页稳定版地址!', {
  453. title: '提示',
  454. closeBtn: 0,
  455. btn: ['确定', '前往快速下载'],
  456. btn1: function (index) {
  457. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  458. layer.close(index);
  459. },
  460. btn2: function (index) {
  461. openUrl(wwConfig.monthCard);
  462. }
  463. })
  464. break;
  465. case 5:
  466. layer.alert('文件大于 3G,插件暂不支持下载,请使用网页稳定版地址(不限制文件大小)!', {
  467. title: '提示',
  468. closeBtn: 0,
  469. btn: ['前往快速下载'],
  470. btn1: function (index) {
  471. openUrl(wwConfig.monthCard);
  472. layer.close(index);
  473. }
  474. })
  475. break;
  476. default:
  477. wwConfig.one_parse.version = 1;
  478. break;
  479. }
  480.  
  481. }
  482. function share_one_baidu(openInfoLayer, url, code, version, type) {
  483. let select = Object.keys(selectList());
  484. let bdstoken = '';
  485. let data_json = {};
  486. try {
  487. data_json = $('html')
  488. .html()
  489. .match(/(?<=locals\.mset\()(.*?)(?=\);)/)[0];
  490. data_json = JSON.parse(data_json);
  491. wwConfig.username = data_json.username;
  492. bdstoken = data_json.bdstoken;
  493. } catch (e) {
  494. data_json = $('html')
  495. .html()
  496. .match(/(?<=window\.locals\s=\s)(.*?)(?=;)/)[0];
  497. data_json = JSON.parse(data_json);
  498. wwConfig.username = data_json.userInfo.username;
  499. bdstoken = data_json.userInfo.bdstoken;
  500. }
  501.  
  502. wwConfig.data_json = data_json;
  503.  
  504. $.ajax({
  505. type: 'GET',
  506. url: 'https://pan.baidu.com/share/set',
  507. async: true,
  508. data: {
  509. bdstoken: bdstoken,
  510. period: 1,
  511. pwd: wwConfig.bdPassword,
  512. eflag_disable: true,
  513. channel_list: '%5B%5D',
  514. schannel: 4,
  515. fid_list: JSON.stringify(select),
  516. },
  517. dataType: 'json',
  518. success: function (res) {
  519. if (res.show_msg.indexOf('禁止') > -1) {
  520. swal({
  521. text: '该文件禁止分享',
  522. icon: 'error',
  523. });
  524. return false;
  525. } else {
  526. let shorturl = '';
  527. try {
  528. shorturl = res.link.split('/').pop();
  529. } catch (error) {
  530. swal({
  531. text: '初始化准备失败',
  532. icon: 'error',
  533. });
  534. return false;
  535. }
  536. fetch(url, {
  537. method: 'POST',
  538. headers: {
  539. 'Content-Type': 'application/json',
  540. },
  541. body: JSON.stringify({
  542. code: code,
  543. userKey: 'main',
  544. fsId: select[0],
  545. version: version,
  546. }),
  547. })
  548. .then((resp) => resp.json())
  549. .then((res) => {
  550. let laysermsg = layer.msg('正在解析中', {
  551. icon: 6,
  552. time: 10000,
  553. });
  554. if (res.code == 200) {
  555. wwConfig.code = code;
  556. if ((res.data.data == 100 & res.data.vip == 0) || (res.data.data == 100 & res.data.vip == 1)) {
  557. let download_url = '';
  558. switch (type) {
  559. case 1:
  560. download_url = wwConfig.mainUrl + 'wp/pc/dlink';
  561. break;
  562. case 2:
  563. download_url = wwConfig.mainUrl + '/wp/fast/pc/dlink';
  564. break;
  565. }
  566. get_down_list(
  567. shorturl,
  568. wwConfig.bdPassword,
  569. openInfoLayer,
  570. res.data,
  571. laysermsg,
  572. download_url
  573. );
  574. }
  575. else if (res.data == 80 || res.data.data == 80) {
  576. init_parse(1);
  577. }
  578. else if (res.data == 60 || res.data.data == 60) {
  579. init_parse(3);
  580. }
  581. else if (res.data == 50 || res.data.data == 50) {
  582. init_parse(2);
  583. }
  584. else if (res.data.data == 100 || res.data.vip == 0) {
  585. init_parse(3);
  586. }
  587. else {
  588. init_parse(2);
  589. }
  590. } else if (res.code == 500) {
  591. layer.close(openInfoLayer);
  592. layer.close(laysermsg);
  593. init_parse(3);
  594. }
  595. });
  596. }
  597. },
  598. error: function (res) {
  599. swal({
  600. text: '初始化准备请求访问失败',
  601. icon: 'error',
  602. });
  603. },
  604. });
  605. }
  606.  
  607. function copy_text(text, msg) {
  608. navigator.clipboard.writeText(text).then(() => {
  609. layer.msg(msg + ' 已复制到剪贴板');
  610. }).catch(err => {
  611. layer.msg('复制失败,请手动复制:' + text);
  612. });
  613. }
  614.  
  615. async function get_down_list(shorturl, password, openInfoLayer, pwd, laysermsg, downloadUrl) {
  616. let ajax_data = {
  617. shorturl: shorturl,
  618. pwd: password,
  619. dir: 1,
  620. root: 1,
  621. userKey: 'main',
  622. };
  623.  
  624. fetch(wwConfig.mainUrl + '/wp/parseCopyLink', {
  625. method: 'POST',
  626. headers: {
  627. 'Content-Type': 'application/json',
  628. },
  629. body: JSON.stringify(ajax_data),
  630. })
  631. .then((resp) => resp.json())
  632. .then((res) => {
  633. if (res.code == 200) {
  634. const size = parseInt(res.data.data.list[0].size);
  635. // if (size > 3221225472) {
  636. // layer.close(openInfoLayer);
  637. // layer.close(laysermsg);
  638. // $('#parseBtn').html('<p>发送到Gopeed</p>');
  639. // init_parse(5);
  640. // return false;
  641. // }
  642. const requestData = {
  643. fsId: res.data.data.list[0].fs_id,
  644. shareid: res.data.data.shareid,
  645. uk: res.data.data.uk,
  646. sekey: res.data.data.seckey,
  647. randsk: res.data.data.seckey,
  648. fs_ids: [res.data.data.list[0].fs_id],
  649. path: res.data.data.list[0].server_filename,
  650. size: res.data.data.list[0].size,
  651. surl: shorturl,
  652. url: `https://pan.baidu.com/s/${shorturl}`,
  653. userKey: 'main',
  654. pwd: password,
  655. dir: '/',
  656. };
  657. // console.log(requestData);
  658. GM_xmlhttpRequest({
  659. method: 'POST',
  660. url: downloadUrl,
  661. headers: {
  662. 'Content-Type': 'application/json',
  663. },
  664. data: JSON.stringify(requestData),
  665. onload: function (response) {
  666. const responseData = JSON.parse(response.responseText);
  667. // console.log(responseData);
  668. if (responseData.code !== 200) {
  669. layer.close(openInfoLayer);
  670. layer.close(laysermsg);
  671. // swal({
  672. // text: responseData.msg,
  673. // icon: 'warning',
  674. // });
  675. init_parse(3);
  676. } else {
  677. layer.close(laysermsg);
  678. $('#parseBtn').html('<p>发送到Gopeed</p>');
  679. if (responseData.data.vip) {
  680. wwConfig.url = responseData.data.data.dlink;
  681. wwConfig.ua = responseData.data.data.ua;
  682. } else {
  683. wwConfig.url = responseData.data.dlink;
  684. wwConfig.ua = responseData.data.ua;
  685. }
  686. sendToGopeed(res.data.data.list[0]);
  687. }
  688. },
  689. onerror: function (response) {
  690. layer.close(openInfoLayer);
  691. layer.close(laysermsg);
  692. const errorMessage =
  693. JSON.parse(response.responseText).message || '网络错误';
  694. swal({
  695. text: '发送到Gopeed遇到问题了,请刷新重试即可!!',
  696. icon: 'warning',
  697. });
  698. },
  699. });
  700. } else {
  701. layer.close(openInfoLayer);
  702. layer.close(laysermsg);
  703. $('#parseBtn').html('<p>发送到Gopeed</p>');
  704. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  705. swal({
  706. text: '发送到Gopeed遇到问题了,请升级插件刷新重试即可!!',
  707. icon: 'warning',
  708. });
  709. }
  710. });
  711. }
  712. function testSendToGopeed() {
  713. return fetch(wwConfig.goPeedTaskUrl, {
  714. method: 'POST',
  715. headers: {
  716. 'Content-Type': 'application/json'
  717. },
  718. })
  719. .then((resp) => resp.json())
  720. .then((res) => {
  721. return true;
  722. }).catch(e => {
  723. return false;
  724. })
  725. }
  726. function sendToGopeed(item) {
  727. fetch(wwConfig.goPeedTaskUrl, {
  728. method: 'POST',
  729. headers: {
  730. 'Content-Type': 'application/json'
  731. },
  732. body: JSON.stringify({
  733. req:
  734. {
  735. url: wwConfig.url,
  736. extra: {
  737. header: {
  738. "User-Agent": wwConfig.ua,
  739. }
  740. }
  741. },
  742. opt: {
  743. extra: {
  744. connections: 256,
  745. }
  746. }
  747. }),
  748. }).then((resp) => resp.json())
  749. .then((res) => {
  750. layer.open({
  751. content: `请打开 Gopeed 查看 <span style="color:rgba(5,150,105,1);">${item.server_filename}</span> 是否开始下载?未下载成功,先设置IDM/NDM User-Agent:<code>` + wwConfig.ua + `</code>,再复制直链下载!`,
  752. btn: ['已下载,关闭弹窗', '复制UA', '未下载,复制直链'],
  753. closeBtn: 0,
  754. type: 1,
  755. btn1: function (index, layero, that) {
  756. layer.close(index);
  757. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  758. },
  759. btn2: function (index, layero, that) {
  760. GM_setClipboard(wwConfig.ua, "text");
  761. layer.msg('UA复制成功!');
  762. return false;
  763. },
  764. btn3: function (index, layero, that) {
  765. GM_setClipboard(wwConfig.url, "text");
  766. layer.msg(`${item.server_filename} 的直链复制成功!`);
  767. $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  768. }
  769. });
  770. // layer.confirm(`请打开 Gopeed 查看 <span style="color:rgba(5,150,105,1);">${item.server_filename}</span> 是否开始下载?未下载成功,先设置IDM/NDM User-Agent:<code>` + wwConfig.ua + `</code>,再复制直链下载!`,
  771. // {
  772. // btn: ['已下载,关闭弹窗', '未下载,复制直链'],
  773. // closeBtn: 0,
  774. // }, function (index) {
  775. // layer.close(index);
  776. // $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  777. // }, function () {
  778. // GM_setClipboard(wwConfig.url, "text");
  779. // layer.msg(`${item.server_filename} 的直链复制成功!`);
  780. // $('#parseWxBtn').html('<p>发送到Gopeed</p>');
  781. // });
  782. }).catch(e => {
  783. })
  784. }
  785. setInterval(() => {
  786. GM_xmlhttpRequest({
  787. method: 'get',
  788. url: wwConfig.goPeedTaskUrl + '?status=running',
  789. headers: {
  790. 'Content-Type': 'application/json',
  791. },
  792. onload: function (response) {
  793. const responseData = JSON.parse(response.responseText);
  794. const result = responseData.data.filter(e =>
  795. e.status === "running"
  796. ).filter((e) => e.progress.speed < 1048576).map(e => e.id);
  797. const ids = result.map((e) => {
  798. return `id=${e}`
  799. }).join('&')
  800. if (ids && ids.length) {
  801. GM_xmlhttpRequest({
  802. method: 'put',
  803. url: `${wwConfig.goPeedTaskUrl}/pause?${ids}`,
  804. headers: {
  805. 'Content-Type': 'application/json',
  806. },
  807. onload: function (response) {
  808. GM_xmlhttpRequest({
  809. method: 'put',
  810. url: `${wwConfig.goPeedTaskUrl}/continue?${ids}`,
  811. headers: {
  812. 'Content-Type': 'application/json',
  813. },
  814. onload: function (response) {
  815. }
  816. })
  817. }
  818. })
  819. }
  820. }
  821. })
  822. }, 15000)
  823.  
  824. })();