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

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

目前为 2024-12-12 提交的版本。查看 最新版本

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