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

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

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

  1. // ==UserScript==
  2. // @name 百度网盘SVIP高速解析不限速下载的直链助手-文武PanDownload
  3. // @namespace https://github.com/dongyubin/Baidu-VIP
  4. // @version 2.3
  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>插件解析限制 2 次</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;" 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.1</span></p>
  156. <p><a href="https://fk.wwkejishe.top/buy/23" target="_blank" style="font-weight: 900;color: #409eff;">
  157. 如需不限次数或者不限制文件大小,请前往下单</a></p>
  158. <p>2023-2024 © Github By <a style="color:#000000" href="https://github.com/dongyubin/Baidu-VIP" target="_blank">@dongyubin</a></p>
  159. </div>
  160. <div class="layui-tab-item" style="background-color: #fff; border-radius: 8px; padding: 20px;text-align: center;">
  161. <div>
  162. <img src="https://cdn.wwkejishe.top/wp-cdn-02/2024/202411171346351.webp" style="width:240px;height:240px;">
  163. </div>
  164. <h2 class="h2" style="margin-top: 10px;">扫一扫不失联</h2>
  165. </div>
  166. </div>
  167. </div>
  168. `,
  169. success: function () {
  170. // 对弹层中的表单进行初始化渲染
  171. form.render();
  172. // 表单提交事件
  173. form.on('submit(demo-send)', async function (data) {
  174. $('#parseBtn').html('<p>正在发送中,请稍后...</p>');
  175. let testDown = await testSendToGopeed();
  176.  
  177. if (!testDown) {
  178. layer.close(openInfoLayer);
  179. swal({
  180. title: "下载 Gopeed 加速器",
  181. text: '请先安装 Gopeed 并打开运行(点击按钮下载 Gopeed)。',
  182. icon: 'warning',
  183. type: "warning",
  184. showCancelButton: true,
  185. showConfirmButton: true,
  186. confirmButtonText: '点击下载Gopeed',
  187. confirmButtonColor: "#dd6b55",
  188. }).then(function () {
  189. window.open('https://pan.quark.cn/s/0b2e9c6e94b0');
  190. });
  191. $('#parseBtn').html('<p>发送到Gopeed</p>');
  192. return;
  193. }
  194. share_one_baidu(openInfoLayer, 1234);
  195. });
  196. },
  197. });
  198. });
  199. });
  200. function selectList() {
  201. var select = {};
  202. var option = [];
  203.  
  204. try {
  205. option =
  206. require('system-core:context/context.js').instanceForSystem.list.getSelected();
  207. } catch (e) {
  208. option = document.querySelector('.wp-s-core-pan').__vue__.selectedList;
  209. }
  210. option.forEach((element) => {
  211. select[element.fs_id] = element;
  212. });
  213. return select;
  214. }
  215. function share_one_baidu(openInfoLayer, code) {
  216. let select = Object.keys(selectList());
  217. let bdstoken = '';
  218. let data_json = {};
  219. try {
  220. data_json = $('html')
  221. .html()
  222. .match(/(?<=locals\.mset\()(.*?)(?=\);)/)[0];
  223. data_json = JSON.parse(data_json);
  224. wwConfig.username = data_json.username;
  225. bdstoken = data_json.bdstoken;
  226. } catch (e) {
  227. data_json = $('html')
  228. .html()
  229. .match(/(?<=window\.locals\s=\s)(.*?)(?=;)/)[0];
  230. data_json = JSON.parse(data_json);
  231. wwConfig.username = data_json.userInfo.username;
  232. bdstoken = data_json.userInfo.bdstoken;
  233. }
  234.  
  235. wwConfig.data_json = data_json;
  236.  
  237. const param = {
  238. bdstoken: bdstoken,
  239. period: 1,
  240. pwd: wwConfig.bdPassword,
  241. eflag_disable: true,
  242. channel_list: '%5B%5D',
  243. schannel: 4,
  244. fid_list: JSON.stringify(select),
  245. };
  246.  
  247. $.ajax({
  248. type: 'GET',
  249. url: 'https://pan.baidu.com/share/set',
  250. async: true,
  251. data: {
  252. bdstoken: bdstoken,
  253. period: 1,
  254. pwd: wwConfig.bdPassword,
  255. eflag_disable: true,
  256. channel_list: '%5B%5D',
  257. schannel: 4,
  258. fid_list: JSON.stringify(select),
  259. },
  260. dataType: 'json',
  261. success: function (res) {
  262. if (res.show_msg.indexOf('禁止') > -1) {
  263. swal({
  264. text: '该文件禁止分享',
  265. icon: 'error',
  266. });
  267. return false;
  268. } else {
  269. let shorturl = '';
  270. try {
  271. shorturl = res.link.split('/').pop();
  272. } catch (error) {
  273. swal({
  274. text: '初始化准备失败',
  275. icon: 'error',
  276. });
  277. return false;
  278. }
  279. fetch(wwConfig.mainUrl + '/wp/getCodeNum', {
  280. method: 'POST',
  281. headers: {
  282. 'Content-Type': 'application/json',
  283. },
  284. body: JSON.stringify({
  285. code: code,
  286. userKey: 'main',
  287. fsId: select[0],
  288. version: '1.1.4',
  289. }),
  290. })
  291. .then((resp) => resp.json())
  292. .then((res) => {
  293. let laysermsg = layer.msg('正在解析中', {
  294. icon: 6,
  295. time: 10000,
  296. });
  297. if (res.code == 200) {
  298. wwConfig.code = code;
  299. if (res.data > 100) {
  300. get_down_list(
  301. shorturl,
  302. wwConfig.bdPassword,
  303. openInfoLayer,
  304. res.data,
  305. laysermsg
  306. );
  307. } else if (res.data == 80) {
  308. layer.msg('解析中', {
  309. icon: 6,
  310. time: 3000,
  311. });
  312. setTimeout(() => {
  313. $('#parseBtn').html('<p>解析</p>');
  314. layer.alert('解析通道比较拥堵,请重试!', {
  315. title: '提示',
  316. });
  317. }, 3000);
  318. } else if (res.data == 60) {
  319. layer.msg('解析中', {
  320. icon: 6,
  321. time: 3000,
  322. });
  323. setTimeout(() => {
  324. $('#parseBtn').html('<p>解析</p>');
  325. layer.alert('解析次数已达上限,不限次数稳定版!', {
  326. title: '提示',
  327. }, function () {
  328. window.open('https://pandown.mlover.site');
  329. });
  330. }, 3000);
  331. } else if (res.data == 50) {
  332. layer.alert(
  333. '验证码错误,一个验证码只能下载一个文件,请重新获取!',
  334. {
  335. title: '提示',
  336. }
  337. );
  338. } else {
  339. layer.alert(
  340. '验证码错误,一个验证码只能下载一个文件,请重新获取!',
  341. {
  342. title: '提示',
  343. }
  344. );
  345. }
  346. } else if (res.code == 500) {
  347. layer.close(openInfoLayer);
  348. layer.close(laysermsg);
  349. swal({
  350. text: res.msg,
  351. icon: 'warning',
  352. });
  353. }
  354. });
  355. }
  356. },
  357. error: function (res) {
  358. swal({
  359. text: '初始化准备请求访问失败',
  360. icon: 'error',
  361. });
  362. },
  363. });
  364. }
  365.  
  366. async function get_down_list(shorturl, password, openInfoLayer, pwd, laysermsg) {
  367. let ajax_data = {
  368. shorturl: shorturl,
  369. pwd: password,
  370. dir: 1,
  371. root: 1,
  372. userKey: 'main',
  373. };
  374.  
  375. fetch(wwConfig.mainUrl + '/wp/parseCopyLink', {
  376. method: 'POST',
  377. headers: {
  378. 'Content-Type': 'application/json',
  379. },
  380. body: JSON.stringify(ajax_data),
  381. })
  382. .then((resp) => resp.json())
  383. .then((res) => {
  384. if (res.code == 200) {
  385. const size = parseInt(res.data.data.list[0].size);
  386. if (size > 3221225472) {
  387. layer.close(openInfoLayer);
  388. layer.close(laysermsg);
  389. $('#parseBtn').html('<p>发送到Gopeed</p>');
  390. swal({
  391. text: '文件大于 3G,插件暂不支持下载,请前往 PC 网页版下载!',
  392. icon: 'warning',
  393. });
  394. return false;
  395. }
  396. const requestData = {
  397. fsId: res.data.data.list[0].fs_id,
  398. shareid: res.data.data.shareid,
  399. uk: res.data.data.uk,
  400. sekey: res.data.data.seckey,
  401. randsk: res.data.data.seckey,
  402. fs_ids: [res.data.data.list[0].fs_id],
  403. path: res.data.data.list[0].server_filename,
  404. size: res.data.data.list[0].size,
  405. surl: shorturl,
  406. url: `https://pan.baidu.com/s/${shorturl}`,
  407. userKey: 'main',
  408. pwd: password,
  409. dir: '/',
  410. };
  411. console.log(requestData);
  412. GM_xmlhttpRequest({
  413. method: 'POST',
  414. url: wwConfig.mainUrl + '/wp/dlink',
  415. headers: {
  416. 'Content-Type': 'application/json',
  417. },
  418. data: JSON.stringify(requestData),
  419. onload: function (response) {
  420. const responseData = JSON.parse(response.responseText);
  421. console.log(responseData);
  422. if (responseData.code !== 200) {
  423. layer.close(openInfoLayer);
  424. layer.close(laysermsg);
  425. swal({
  426. text: responseData.msg,
  427. icon: 'warning',
  428. });
  429. } else {
  430. layer.close(laysermsg);
  431. $('#parseBtn').html('<p>发送到Gopeed</p>');
  432. if (responseData.data.vip) {
  433. wwConfig.url = responseData.data.data[0].url;
  434. wwConfig.ua = responseData.data.data[0].ua;
  435. } else {
  436. wwConfig.url = responseData.data.data.urls[0].url;
  437. }
  438. sendToGopeed(res.data.data.list[0]);
  439. }
  440. },
  441. onerror: function (response) {
  442. layer.close(openInfoLayer);
  443. layer.close(laysermsg);
  444. const errorMessage =
  445. JSON.parse(response.responseText).message || '网络错误';
  446. swal({
  447. text: '发送到Gopeed遇到问题了,请刷新重试即可!!',
  448. icon: 'warning',
  449. });
  450. },
  451. });
  452. } else {
  453. layer.close(openInfoLayer);
  454. layer.close(laysermsg);
  455. $('#parseBtn').html('<p>发送到Gopeed</p>');
  456. swal({
  457. text: '发送到Gopeed遇到问题了,请升级插件刷新重试即可!!',
  458. icon: 'warning',
  459. });
  460. }
  461. });
  462. }
  463. function testSendToGopeed() {
  464. return fetch(wwConfig.goPeedTaskUrl, {
  465. method: 'POST',
  466. headers: {
  467. 'Content-Type': 'application/json'
  468. },
  469. })
  470. .then((resp) => resp.json())
  471. .then((res) => {
  472. return true;
  473. }).catch(e => {
  474. return false;
  475. })
  476. }
  477. function sendToGopeed(item) {
  478. fetch(wwConfig.goPeedTaskUrl, {
  479. method: 'POST',
  480. headers: {
  481. 'Content-Type': 'application/json'
  482. },
  483. body: JSON.stringify({
  484. req:
  485. {
  486. url: wwConfig.url,
  487. extra: {
  488. header: {
  489. "User-Agent": wwConfig.ua,
  490. }
  491. }
  492. },
  493. opt: {
  494. extra: {
  495. connections: 256,
  496. }
  497. }
  498. }),
  499. }).then((resp) => resp.json())
  500. .then((res) => {
  501. layer.confirm(`请打开 Gopeed 查看 ${item.server_filename} 是否开始下载?未下载成功,先设置IDM/NDM User-Agent:<code>netdisk;1.0.1</code>,再复制直链下载!`, {
  502. btn: ['已下载,关闭弹窗', '未下载,复制直链']
  503. }, function (index) {
  504. layer.close(index);
  505. }, function () {
  506. GM_setClipboard(wwConfig.url, "text");
  507. layer.msg(`${item.server_filename} 的直链复制成功!`);
  508. });
  509. }).catch(e => {
  510. })
  511. }
  512. setInterval(() => {
  513. GM_xmlhttpRequest({
  514. method: 'get',
  515. url: wwConfig.goPeedTaskUrl + '?status=running',
  516. headers: {
  517. 'Content-Type': 'application/json',
  518. },
  519. onload: function (response) {
  520. const responseData = JSON.parse(response.responseText);
  521. const result = responseData.data.filter(e =>
  522. e.status === "running"
  523. ).filter((e) => e.progress.speed < 1048576).map(e => e.id);
  524. const ids = result.map((e) => {
  525. return `id=${e}`
  526. }).join('&')
  527. if (ids && ids.length) {
  528. GM_xmlhttpRequest({
  529. method: 'put',
  530. url: `${wwConfig.goPeedTaskUrl}/pause?${ids}`,
  531. headers: {
  532. 'Content-Type': 'application/json',
  533. },
  534. onload: function (response) {
  535. GM_xmlhttpRequest({
  536. method: 'put',
  537. url: `${wwConfig.goPeedTaskUrl}/continue?${ids}`,
  538. headers: {
  539. 'Content-Type': 'application/json',
  540. },
  541. onload: function (response) {
  542. }
  543. })
  544. }
  545. })
  546. }
  547. }
  548. })
  549. }, 15000)
  550.  
  551. })();