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

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

Ekde 2025/01/18. Vidu La ĝisdata versio.

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