Greasy Fork 支持简体中文。

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

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

目前為 2024-12-17 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 百度网盘SVIP高速解析直链的不限速下载助手-文武PanDownload
  3. // @namespace https://github.com/dongyubin/Baidu-VIP
  4. // @version 2.7
  5. // @description 不限制速度的百度网盘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. // @require https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.18/layui.min.js
  12. // @resource layuiCSS https://cdnjs.cloudflare.com/ajax/libs/layui/2.9.18/css/layui.css
  13. // @require https://unpkg.com/sweetalert/dist/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 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. // @antifeature ads
  42. // @antifeature membership
  43. // @antifeature referral-link
  44. // ==/UserScript==
  45. (function () {
  46. 'use strict';
  47. const layuiCss = GM_getResourceText('layuiCSS');
  48. GM_addStyle(layuiCss);
  49. const wwConfig = {
  50. mainUrl: 'https://aifenxiang.net.cn:8081',
  51. bdPassword: '1234',
  52. titleName: '文武Download',
  53. goPeedTaskUrl: 'http://127.0.0.1:9999/api/v1/tasks'
  54. };
  55. layui.use(['layer'], async function () {
  56. var layer = layui.layer,
  57. $ = layui.$;
  58. var form = layui.form;
  59. if (location.href.startsWith('https://pan.baidu.com/s/')) {
  60. $('.x-button-box').prepend(
  61. '<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;">' +
  62. wwConfig.titleName +
  63. '</lable></span></a>'
  64. );
  65. } else {
  66. if ($('.tcuLAu').is('*')) {
  67. $('.tcuLAu').prepend(
  68. '<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;">' +
  69. wwConfig.titleName +
  70. '</lable></span></a></span>'
  71. );
  72. } else {
  73. $('.wp-s-agile-tool-bar__header.is-header-tool').prepend(
  74. '<div class="wp-s-agile-tool-bar__h-group"><button style=" margin-right: 10px;color: #fff;background-color: #06a7ff;border:none;" id="downbtn_main" class="u-button nd-file-list-toolbar-action-item" ><i style="top:0;" class="iconfont icon-download"></i> <lable>' +
  75. wwConfig.titleName +
  76. '</lable></button></div>'
  77. );
  78. }
  79. }
  80. $('#downbtn_share').click(function () {
  81. swal({
  82. title: '提示',
  83. text: '请先保存到自己的网盘后,在网盘里解析下载!',
  84. icon: 'warning',
  85. });
  86. return false;
  87. });
  88. $('#downbtn_main').click(function () {
  89. let select = selectList();
  90. let selected = Object.keys(select);
  91. if (selected.length == 0) {
  92. swal({
  93. text: '请先选择一个文件',
  94. icon: 'warning',
  95. });
  96. return false;
  97. } else if (selected.length > 1) {
  98. swal({
  99. text: '目前仅支持单个文件解析',
  100. icon: 'warning',
  101. });
  102. return false;
  103. } else if (select[selected[0]].isdir == 1) {
  104. swal({
  105. text: '目前不支持文件夹解析',
  106. icon: 'warning',
  107. });
  108. return false;
  109. }
  110.  
  111. const wwJieXiDiv = document.createElement('div');
  112. let createDiv = `
  113. <div>
  114. <img src="https://cdn.wwkejishe.top/wp-cdn-02/2024/202411171346351.webp" style="width:240px;height:240px;">
  115. </div>
  116. <div>
  117. <input style="border:1px solid #ccc; width:60%;height:40px;text-indent:20px;" type="text" autocomplete="off" placeholder="请输入验证码" id="wpCode"/>
  118. </div>
  119. `;
  120. wwJieXiDiv.innerHTML = createDiv;
  121.  
  122. const openInfoLayer = layer.open({
  123. type: 1,
  124. area: ['550px', 'auto'],
  125. title: '提示',
  126. type: 1,
  127. shade: 0.6,
  128. shadeClose: true,
  129. anim: 0,
  130. content: `
  131. <div class="layui-tab layui-tab-brief" style="background-color: #f8f8f8; border-radius: 8px;">
  132. <ul class="layui-tab-title" style="background-color: #fff; border-bottom: 1px solid #e6e6e6;">
  133. <li class="layui-this">解析</li>
  134. <li>更多资源</li>
  135. <li>防止失联</li>
  136. </ul>
  137. <div class="layui-tab-content" style="padding: 20px;">
  138. <div class="layui-tab-item layui-show">
  139. <div class="layui-form" lay-filter="filter-test-layer" style="width:360px;margin: 16px auto 0; background-color: #fff; border-radius: 8px; padding: 20px;">
  140. <div class="demo-send-container">
  141. <div>
  142. <p>插件解析限制 <span class="piao">2</span> 次</p>
  143. <p>
  144. Gopeed 下载器一定要配置好 User-Agent 和端口: <a style="color:red;" target="_blank" href="https://flowus.cn/share/c68e3c55-67e5-460f-b937-7727e0378a34?code=BCRWJL">点击查看 Gopeed 配置教程说明</a>
  145. </p>
  146. <p>
  147. 不限次数 PC 网页稳定版: <a style="color:red;font-weight:900;" target="_blank" href="https://pandown.mlover.site/">点击前往</a>
  148. </p>
  149. </div>
  150. <button style="margin-left:0;margin-top:30px; border-radius: 8px;" id="parseBtn" class="layui-btn layui-btn-fluid" lay-submit lay-filter="demo-send">点击发送到Gopeed</button>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="layui-tab-item" style="background-color: #fff; border-radius: 8px; padding: 20px;">
  155. <p>当前最新的脚本为:<span class="piao">2.7</span></p>
  156. <p>&nbsp;</p>
  157. <p><a href="https://fk.wwkejishe.top/buy/23" target="_blank" style="font-weight: 900;color: #409eff;">
  158. 购买月卡:不限次数、不限制文件大小、不限速</a></p>
  159. <p>
  160. <p>&nbsp;</p>
  161. <figure class='table-figure'>
  162. <table class="layui-table" style="border-collapse: separate;">
  163. <thead>
  164. <tr>
  165. <th style="background-color: #f8f8f8; border-bottom: 2px solid #e6e6e6; padding: 10px;">百度VIP</th>
  166. <th style="background-color: #f8f8f8; border-bottom: 2px solid #e6e6e6; padding: 10px;">百度SVIP</th>
  167. <th style="background-color: #f8f8f8; border-bottom: 2px solid #e6e6e6; padding: 10px;">
  168. <a href='https://fk.wwkejishe.top/buy/23' target='_blank' style='color: #007bff; text-decoration: none;'>Pandownload月卡</a>
  169. </th>
  170. </tr>
  171. </thead>
  172. <tbody>
  173. <tr>
  174. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">¥25/月</td>
  175. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">¥40/月</td>
  176. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;color: rgba(5,150,105,1)">¥9/月</td>
  177. </tr>
  178. <tr>
  179. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">20G/月</td>
  180. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;">不限制</td>
  181. <td style="padding: 10px; border-bottom: 1px solid #e6e6e6;color: rgba(5,150,105,1)">不限制文件大小、不限制文件数量、高速下载</td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. </figure>
  186. <p>&nbsp;</p>
  187. <p>
  188. <a href="http://vip.jiufei.com/lin/GI5LG4?refer=1661" target="_blank" style="color: #007bff; text-decoration: none;">点击购买(高质量)网盘会员</a>:¥3/4天,¥7.5/25天,¥22.8/年
  189. </p>
  190. <p>&nbsp;</p>
  191. <p>2023-2024 © Github By <a style="color:#007bff;" href="https://github.com/dongyubin/Baidu-VIP" target="_blank">@dongyubin</a></p>
  192. </div>
  193. <div class="layui-tab-item" style="background-color: #fff; border-radius: 8px; padding: 20px;text-align: center;">
  194. <div>
  195. <img src="https://cdn.wwkejishe.top/wp-cdn-02/2024/202411171346351.webp" style="width:240px;height:240px;">
  196. </div>
  197. <h2 class="h2" style="margin-top: 10px;">扫一扫,不失联</h2>
  198. <h3 class="h2" style="margin-top: 10px;">众所周知,脚本不可能每时每刻都能用。关注不迷路 ~</h3>
  199. </div>
  200. </div>
  201. </div>
  202. `,
  203. success: function () {
  204. // 对弹层中的表单进行初始化渲染
  205. form.render();
  206. // 表单提交事件
  207. form.on('submit(demo-send)', async function (data) {
  208. $('#parseBtn').html('<p>正在发送中,请稍后...</p>');
  209. let testDown = await testSendToGopeed();
  210.  
  211. if (!testDown) {
  212. layer.close(openInfoLayer);
  213. swal({
  214. title: "下载 Gopeed 加速器",
  215. text: '请先安装 Gopeed 并打开运行(点击按钮下载 Gopeed)。',
  216. icon: 'warning',
  217. type: "warning",
  218. showCancelButton: true,
  219. showConfirmButton: true,
  220. confirmButtonText: '点击下载Gopeed',
  221. confirmButtonColor: "#dd6b55",
  222. }).then(function () {
  223. window.open('https://pan.quark.cn/s/0b2e9c6e94b0');
  224. });
  225. $('#parseBtn').html('<p>发送到Gopeed</p>');
  226. return;
  227. }
  228. share_one_baidu(openInfoLayer, 'bd');
  229. });
  230. },
  231. });
  232. });
  233. });
  234. function selectList() {
  235. var select = {};
  236. var option = [];
  237.  
  238. try {
  239. option =
  240. require('system-core:context/context.js').instanceForSystem.list.getSelected();
  241. } catch (e) {
  242. option = document.querySelector('.wp-s-core-pan').__vue__.selectedList;
  243. }
  244. option.forEach((element) => {
  245. select[element.fs_id] = element;
  246. });
  247. return select;
  248. }
  249. function share_one_baidu(openInfoLayer, code) {
  250. let select = Object.keys(selectList());
  251. let bdstoken = '';
  252. let data_json = {};
  253. try {
  254. data_json = $('html')
  255. .html()
  256. .match(/(?<=locals\.mset\()(.*?)(?=\);)/)[0];
  257. data_json = JSON.parse(data_json);
  258. wwConfig.username = data_json.username;
  259. bdstoken = data_json.bdstoken;
  260. } catch (e) {
  261. data_json = $('html')
  262. .html()
  263. .match(/(?<=window\.locals\s=\s)(.*?)(?=;)/)[0];
  264. data_json = JSON.parse(data_json);
  265. wwConfig.username = data_json.userInfo.username;
  266. bdstoken = data_json.userInfo.bdstoken;
  267. }
  268.  
  269. wwConfig.data_json = data_json;
  270.  
  271. const param = {
  272. bdstoken: bdstoken,
  273. period: 1,
  274. pwd: wwConfig.bdPassword,
  275. eflag_disable: true,
  276. channel_list: '%5B%5D',
  277. schannel: 4,
  278. fid_list: JSON.stringify(select),
  279. };
  280.  
  281. $.ajax({
  282. type: 'GET',
  283. url: 'https://pan.baidu.com/share/set',
  284. async: true,
  285. data: {
  286. bdstoken: bdstoken,
  287. period: 1,
  288. pwd: wwConfig.bdPassword,
  289. eflag_disable: true,
  290. channel_list: '%5B%5D',
  291. schannel: 4,
  292. fid_list: JSON.stringify(select),
  293. },
  294. dataType: 'json',
  295. success: function (res) {
  296. if (res.show_msg.indexOf('禁止') > -1) {
  297. swal({
  298. text: '该文件禁止分享',
  299. icon: 'error',
  300. });
  301. return false;
  302. } else {
  303. let shorturl = '';
  304. try {
  305. shorturl = res.link.split('/').pop();
  306. } catch (error) {
  307. swal({
  308. text: '初始化准备失败',
  309. icon: 'error',
  310. });
  311. return false;
  312. }
  313. fetch(wwConfig.mainUrl + '/wp/getCodeNum', {
  314. method: 'POST',
  315. headers: {
  316. 'Content-Type': 'application/json',
  317. },
  318. body: JSON.stringify({
  319. code: code,
  320. userKey: 'main',
  321. fsId: select[0],
  322. version: '1.1.4',
  323. }),
  324. })
  325. .then((resp) => resp.json())
  326. .then((res) => {
  327. let laysermsg = layer.msg('正在解析中', {
  328. icon: 6,
  329. time: 10000,
  330. });
  331. if (res.code == 200) {
  332. wwConfig.code = code;
  333. if (res.data > 100) {
  334. get_down_list(
  335. shorturl,
  336. wwConfig.bdPassword,
  337. openInfoLayer,
  338. res.data,
  339. laysermsg
  340. );
  341. } else if (res.data == 80) {
  342. layer.msg('解析中', {
  343. icon: 6,
  344. time: 3000,
  345. });
  346. setTimeout(() => {
  347. $('#parseBtn').html('<p>解析</p>');
  348. layer.alert('解析通道比较拥堵,请重试!', {
  349. title: '提示',
  350. });
  351. }, 3000);
  352. } else if (res.data == 60) {
  353. layer.msg('解析中', {
  354. icon: 6,
  355. time: 3000,
  356. });
  357. setTimeout(() => {
  358. $('#parseBtn').html('<p>解析</p>');
  359. layer.alert('解析次数已达上限,不限次数稳定版!', {
  360. title: '提示',
  361. }, function () {
  362. window.open('https://pandown.mlover.site');
  363. });
  364. }, 3000);
  365. } else if (res.data == 50) {
  366. layer.alert(
  367. '验证码错误,一个验证码只能下载一个文件,请重新获取!',
  368. {
  369. title: '提示',
  370. }
  371. );
  372. } else {
  373. layer.alert(
  374. '验证码错误,一个验证码只能下载一个文件,请重新获取!',
  375. {
  376. title: '提示',
  377. }
  378. );
  379. }
  380. } else if (res.code == 500) {
  381. layer.close(openInfoLayer);
  382. layer.close(laysermsg);
  383. swal({
  384. text: res.msg,
  385. icon: 'warning',
  386. });
  387. }
  388. });
  389. }
  390. },
  391. error: function (res) {
  392. swal({
  393. text: '初始化准备请求访问失败',
  394. icon: 'error',
  395. });
  396. },
  397. });
  398. }
  399.  
  400. async function get_down_list(shorturl, password, openInfoLayer, pwd, laysermsg) {
  401. let ajax_data = {
  402. shorturl: shorturl,
  403. pwd: password,
  404. dir: 1,
  405. root: 1,
  406. userKey: 'main',
  407. };
  408.  
  409. fetch(wwConfig.mainUrl + '/wp/parseCopyLink', {
  410. method: 'POST',
  411. headers: {
  412. 'Content-Type': 'application/json',
  413. },
  414. body: JSON.stringify(ajax_data),
  415. })
  416. .then((resp) => resp.json())
  417. .then((res) => {
  418. if (res.code == 200) {
  419. const size = parseInt(res.data.data.list[0].size);
  420. if (size > 3221225472) {
  421. layer.close(openInfoLayer);
  422. layer.close(laysermsg);
  423. $('#parseBtn').html('<p>发送到Gopeed</p>');
  424. swal({
  425. text: '文件大于 3G,插件暂不支持下载,请前往 PC 网页版下载!',
  426. icon: 'warning',
  427. });
  428. return false;
  429. }
  430. const requestData = {
  431. fsId: res.data.data.list[0].fs_id,
  432. shareid: res.data.data.shareid,
  433. uk: res.data.data.uk,
  434. sekey: res.data.data.seckey,
  435. randsk: res.data.data.seckey,
  436. fs_ids: [res.data.data.list[0].fs_id],
  437. path: res.data.data.list[0].server_filename,
  438. size: res.data.data.list[0].size,
  439. surl: shorturl,
  440. url: `https://pan.baidu.com/s/${shorturl}`,
  441. userKey: 'main',
  442. pwd: password,
  443. dir: '/',
  444. };
  445. console.log(requestData);
  446. GM_xmlhttpRequest({
  447. method: 'POST',
  448. url: wwConfig.mainUrl + '/wp/dlink',
  449. headers: {
  450. 'Content-Type': 'application/json',
  451. },
  452. data: JSON.stringify(requestData),
  453. onload: function (response) {
  454. const responseData = JSON.parse(response.responseText);
  455. console.log(responseData);
  456. if (responseData.code !== 200) {
  457. layer.close(openInfoLayer);
  458. layer.close(laysermsg);
  459. swal({
  460. text: responseData.msg,
  461. icon: 'warning',
  462. });
  463. } else {
  464. layer.close(laysermsg);
  465. $('#parseBtn').html('<p>发送到Gopeed</p>');
  466. if (responseData.data.vip) {
  467. wwConfig.url = responseData.data.data[0].url;
  468. wwConfig.ua = responseData.data.data[0].ua;
  469. } else {
  470. wwConfig.url = responseData.data.data.urls[0].url;
  471. }
  472. sendToGopeed(res.data.data.list[0]);
  473. }
  474. },
  475. onerror: function (response) {
  476. layer.close(openInfoLayer);
  477. layer.close(laysermsg);
  478. const errorMessage =
  479. JSON.parse(response.responseText).message || '网络错误';
  480. swal({
  481. text: '发送到Gopeed遇到问题了,请刷新重试即可!!',
  482. icon: 'warning',
  483. });
  484. },
  485. });
  486. } else {
  487. layer.close(openInfoLayer);
  488. layer.close(laysermsg);
  489. $('#parseBtn').html('<p>发送到Gopeed</p>');
  490. swal({
  491. text: '发送到Gopeed遇到问题了,请升级插件刷新重试即可!!',
  492. icon: 'warning',
  493. });
  494. }
  495. });
  496. }
  497. function testSendToGopeed() {
  498. return fetch(wwConfig.goPeedTaskUrl, {
  499. method: 'POST',
  500. headers: {
  501. 'Content-Type': 'application/json'
  502. },
  503. })
  504. .then((resp) => resp.json())
  505. .then((res) => {
  506. return true;
  507. }).catch(e => {
  508. return false;
  509. })
  510. }
  511. function sendToGopeed(item) {
  512. fetch(wwConfig.goPeedTaskUrl, {
  513. method: 'POST',
  514. headers: {
  515. 'Content-Type': 'application/json'
  516. },
  517. body: JSON.stringify({
  518. req:
  519. {
  520. url: wwConfig.url,
  521. extra: {
  522. header: {
  523. "User-Agent": wwConfig.ua,
  524. }
  525. }
  526. },
  527. opt: {
  528. extra: {
  529. connections: 256,
  530. }
  531. }
  532. }),
  533. }).then((resp) => resp.json())
  534. .then((res) => {
  535. layer.confirm(`请打开 Gopeed 查看 ${item.server_filename} 是否开始下载?未下载成功,先设置IDM/NDM User-Agent:<code>netdisk;1.0.1</code>,再复制直链下载!`, {
  536. btn: ['已下载,关闭弹窗', '未下载,复制直链']
  537. }, function (index) {
  538. layer.close(index);
  539. }, function () {
  540. GM_setClipboard(wwConfig.url, "text");
  541. layer.msg(`${item.server_filename} 的直链复制成功!`);
  542. });
  543. }).catch(e => {
  544. })
  545. }
  546. setInterval(() => {
  547. GM_xmlhttpRequest({
  548. method: 'get',
  549. url: wwConfig.goPeedTaskUrl + '?status=running',
  550. headers: {
  551. 'Content-Type': 'application/json',
  552. },
  553. onload: function (response) {
  554. const responseData = JSON.parse(response.responseText);
  555. const result = responseData.data.filter(e =>
  556. e.status === "running"
  557. ).filter((e) => e.progress.speed < 1048576).map(e => e.id);
  558. const ids = result.map((e) => {
  559. return `id=${e}`
  560. }).join('&')
  561. if (ids && ids.length) {
  562. GM_xmlhttpRequest({
  563. method: 'put',
  564. url: `${wwConfig.goPeedTaskUrl}/pause?${ids}`,
  565. headers: {
  566. 'Content-Type': 'application/json',
  567. },
  568. onload: function (response) {
  569. GM_xmlhttpRequest({
  570. method: 'put',
  571. url: `${wwConfig.goPeedTaskUrl}/continue?${ids}`,
  572. headers: {
  573. 'Content-Type': 'application/json',
  574. },
  575. onload: function (response) {
  576. }
  577. })
  578. }
  579. })
  580. }
  581. }
  582. })
  583. }, 15000)
  584.  
  585. })();