迅雷云盘

获取迅雷云盘的文件链接,可利用本地播放器看视频;可将播放列表导入坚果云;可利用其他工具下载(如idm,curl,Xdown,Motrix,Aria2);添加隐藏回收站功能,可自由彻底删除、还原。

安裝腳本?
作者推薦腳本

您可能也會喜歡 壁垒搜索

安裝腳本
  1. // ==UserScript==
  2. // @name 迅雷云盘
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.0.3
  5. // @description 获取迅雷云盘的文件链接,可利用本地播放器看视频;可将播放列表导入坚果云;可利用其他工具下载(如idm,curl,Xdown,Motrix,Aria2);添加隐藏回收站功能,可自由彻底删除、还原。
  6. // @author bleu
  7. // @compatible edge Tampermonkey
  8. // @compatible chrome Tampermonkey
  9. // @compatible firefox Tampermonkey
  10. // @license MIT
  11. // @icon https://fastly.jsdelivr.net/gh/Bleu404/PRPO@latest/png/xunlei.png
  12. // @supportURL https://gf.qytechs.cn/zh-CN/scripts/431256/feedback
  13. // @match https://pan.xunlei.com/*
  14. // @grant GM_xmlhttpRequest
  15. // @grant GM_download
  16. // @grant GM_registerMenuCommand
  17. // @connect *
  18. // @connect localhost
  19. // @connect 127.0.0.1
  20. // @connect xunlei.com
  21. // @connect dav.jianguoyun.com
  22. // @require https://fastly.jsdelivr.net/npm/sweetalert2@11.1.0/dist/sweetalert2.all.min.js
  23. // @require https://fastly.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js
  24. // @require https://fastly.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js
  25. // ==/UserScript==
  26. (function () {
  27. 'use strict';
  28. const originFetch = fetch;
  29. let linkConfig, reqHeaders, filesURL,arryIndex,fileArry,filetxt,temp_path,OSflag;
  30. let running = {
  31. 'runStatus': false,
  32. 'successNum': 0,
  33. 'failNum': 0,
  34. 'exit': false,
  35. 'resultNum': 0,
  36. }
  37. let $BleuButton,$deleteBut;
  38. isResetConfig();
  39. //退出配置保存数据
  40. function swalCloseFunc() {
  41. let local_path = $('#config_path').val().trim();
  42. let aria2 = {
  43. 'ip': $('#config_ip').val().trim(),
  44. 'port': $('#config_port').val().trim(),
  45. 'token': $('#config_token').val().trim(),
  46. };
  47. let jgy = {
  48. 'path': $('#jgy_path').val().trim(),
  49. 'account': $('#jgy_account').val().trim(),
  50. 'password': $('#jgy_password').val().trim(),
  51. };
  52. let qualityAry = $('#bleu_select').val();
  53. qualityAry = qualityAry === 'highlow' ? ['selected', ''] : ['', 'selected'];
  54. let checkAry = [],
  55. autoClick = {
  56. state: false,
  57. itemIndex: 0
  58. },
  59. itemcount = 0;
  60. $('.td-checkbox__inner.bleu').each((index, item) => {
  61. checkAry[index] = '';
  62. if (item.checked) {
  63. checkAry[index] = 'checked';
  64. autoClick.itemIndex = index;
  65. itemcount++;
  66. }
  67. if (index === $('.td-checkbox__inner.bleu').length - 1 && itemcount === 1) {
  68. autoClick.state = true;
  69. }
  70. })
  71. $('.td-checkbox__inner.bleucb').each((index, item) => {
  72. checkAry[item.getAttribute('index')] = '';
  73. if (item.checked) {
  74. checkAry[item.getAttribute('index')] = 'checked';
  75. }
  76. })
  77. localStorage.setItem("linkConfig", JSON.stringify({
  78. 'local_path': local_path,
  79. 'displays': checkAry,
  80. 'aria2': aria2,
  81. 'jgy': jgy,
  82. 'quality': qualityAry,
  83. 'autoClick': autoClick,
  84. }));
  85. if (local_path.indexOf("/") >= 0) {
  86. OSflag = "/";
  87. }
  88. window.ariaNgUI && window.ariaNgUI.close();
  89. }
  90. //初始或者取配置json
  91. function isResetConfig() {
  92. linkConfig = JSON.parse(localStorage.getItem("linkConfig")) || {
  93. 'local_path': 'D:\\Downloads',
  94. 'displays': ['checked', 'checked', 'checked', 'checked', 'checked', 'checked', '', ''],
  95. 'aria2': {
  96. 'ip': 'http://localhost',
  97. 'port': '16800',
  98. 'token': ''
  99. },
  100. 'jgy': {
  101. 'path': 'ThunderPlaylist',
  102. 'account': '',
  103. 'password': ''
  104. },
  105. 'quality': ['selected', ''],
  106. };
  107. if (!linkConfig.jgy) {
  108. linkConfig.jgy = {
  109. 'path': 'ThunderPlaylist',
  110. 'account': '',
  111. 'password': ''
  112. }
  113. }
  114. }
  115. let main = {
  116. addCssStyle() {
  117. let style = document.createElement('style');
  118. style.innerHTML = tools.cssStyle;
  119. document.querySelector('head').appendChild(style);
  120. },
  121. addElements() {
  122. $BleuButton = $('<div id="bleu_btn" class="FileMenu__item--7MGwA active"><i class="xlpfont xlp-download"></i><span>直链</span></div>');
  123. $deleteBut = $('<li id="bleu_trash" class=""><p class="bar-box"><i class="xlpfont xlp-trash"></i> <span>回收站</span></p></li>');
  124. $('div.pan-wrapper-asider ul li').length == 5&&$('div.pan-wrapper-asider ul').append($deleteBut);
  125. $('div.pan-list-menu').length>0&&$('div.pan-list-menu')[0].innerText.indexOf('彻底删除')!=0&&$('div.pan-list-menu').prepend($BleuButton);
  126. $('.FileMenu__menu--XBFEH').length != 0 ? $('.FileMenu__menu--XBFEH').prepend($BleuButton) : $BleuButton;
  127.  
  128. if(location.href.indexOf('https://pan.xunlei.com/?filter=trash')==0){
  129. $('#bleu_trash')[0].className = 'on';
  130. }
  131. $('div.pan-wrapper-asider ul li').on('click', ()=>{
  132. $('div.pan-list-menu').length>0&&$('div.pan-list-menu')[0].innerText.indexOf('彻底删除')!=0&&$('div.pan-list-menu').prepend($BleuButton);
  133. if(location.href.indexOf('https://pan.xunlei.com/?filter=trash')!=0){
  134. $('#bleu_trash')[0].className = '';
  135. }
  136. })
  137. },
  138. addButtonEvent() {
  139. $BleuButton.on('click', async function () {
  140. main.getHeaders();
  141. tools.swalForInfo('==获取直链中,请等待==', '', 'center');
  142. if (running.runStatus) {
  143. return
  144. }
  145. isResetConfig();
  146. try {
  147. await main.getAllInfo();
  148. } catch (error) {
  149. console.log(error);
  150. tools.swalForInfo('==请刷新页面重新尝试!==', '', 'center');
  151. running.runStatus = false;
  152. return;
  153. }
  154. let mainui = tools.swalForUI(`成功${running.successNum}条;失败${running.failNum}条`, tools.swalHtml(),400+'px');
  155. $('.btn_bleu').on('click', function (item) {
  156. let temp = item.target.defaultValue;
  157. main.getCollatedData(temp)
  158. })
  159. if (linkConfig.autoClick.state) {
  160. $('.btn_bleu')[linkConfig.autoClick.itemIndex].click();
  161. setTimeout(() => {
  162. mainui.close();
  163. }, 1000);
  164. }
  165. })
  166. GM_registerMenuCommand('直链配置', () => {
  167. isResetConfig();
  168. tools.swalForUI(`直链配置`, tools.swalConfig(),'400px').then(swalCloseFunc);
  169. })
  170. $deleteBut.on('click', function () {
  171. this.className='on';
  172. location.href ='https://pan.xunlei.com/?filter=trash&path=%2F';
  173. })
  174. },
  175. setInitValue() {
  176. arryIndex = 0;
  177. fileArry = [[]];
  178. filetxt = [];
  179. temp_path = '';
  180. running.runStatus = true;
  181. running.successNum = 0;
  182. running.failNum = 0;
  183. running.resultNum = 0;
  184. },
  185. async getAllInfo() {
  186. main.setInitValue();
  187. $('li.SourceListItem__item--XxpOC.SourceListItem__active--4U0f4').each((index,item) => {
  188. let temp = item.__vue__.info
  189. let itemInfo = {
  190. 'kind': temp.kind,
  191. 'id': temp.id,
  192. 'name': temp.name,
  193. 'phase': temp.phase,
  194. 'trashed': temp.trashed
  195. };
  196. fileArry[arryIndex].push(itemInfo);
  197. });
  198. await main.getAllFiles(fileArry[0]);
  199. running.runStatus = false;
  200. running.resultNum = running.successNum + running.failNum;
  201. },
  202. async getAllFiles(loopArry) {
  203. for (let index = 0; index < loopArry.length; index++) {
  204. if (loopArry[index]) {
  205. if (loopArry[index].kind === 'drive#file') {
  206. await main.getDirectLink(loopArry[index].id);
  207. }
  208. if (loopArry[index].kind === 'drive#folder') {
  209. temp_path += `${OSflag}${loopArry[index].name}`;
  210. await main.getFileSign(loopArry[index]);
  211. await main.getAllFiles(fileArry[arryIndex - 1]);
  212. }
  213. }
  214.  
  215. }
  216. temp_path = temp_path.substring(0, temp_path.lastIndexOf(OSflag));
  217. },
  218. getFileSign(folder) {
  219. let runURL = `https://api-pan.xunlei.com/drive/v1/files?limit=100&parent_id=${folder.id}&filters={"phase":{"eq":"${folder.phase}"},"trashed":{"eq":${folder.trashed}}}&with_audit=true`;
  220. runURL = encodeURI(runURL);
  221. fileArry[arryIndex] = [];
  222. return tools.bleuAjax('get', runURL).then(value => {
  223. value.files.forEach((item) => {
  224. let temp = {
  225. 'kind': item.kind,
  226. 'id': item.id,
  227. 'name': item.name,
  228. 'phase': item.phase,
  229. 'trashed': item.trashed
  230. };
  231. fileArry[arryIndex].push(temp);
  232. });
  233. arryIndex++;
  234. }, reason => {
  235. runURL === filesURL ? running.exit = true : running.exit = false;
  236. console.error(reason);
  237. });
  238. },
  239. getDirectLink(sign) {
  240. let URL = `https://api-pan.xunlei.com/drive/v1/files/${sign}`;
  241. return tools.bleuAjax('get', URL).then(value => {
  242. running.successNum++;
  243. let mediasLink = [];
  244. if (value.medias != []) {
  245. value.medias.forEach(function (item) {
  246. if (item.link != null) {
  247. mediasLink.push({
  248. 'name': item.media_name,
  249. 'url': item.media_name === '原始画质' ? value.web_content_link : item.link.url,
  250. })
  251. }
  252. })
  253. }
  254. filetxt.push({
  255. 'name': value.name,
  256. 'link': value.web_content_link,
  257. 'path': temp_path,
  258. 'medias': mediasLink
  259. });
  260. }, reason => {
  261. running.failNum++;
  262. console.log(reason);
  263. });
  264. },
  265. //整理发送到其他工具的数据
  266. async getCollatedData(dataType) {
  267. if (running.resultNum === 0) {
  268. return;
  269. }
  270. if (dataType.match('aria2')) {
  271. tools.swalForInfo('==基于aria2发送RPC任务中,请等待==', '', 'center');
  272. }
  273. let nameLinkTxt = '';
  274. let mediaIndex, selectedURL;
  275. if (dataType.match('播放')) {
  276. nameLinkTxt = '#EXTM3U\n'
  277. }
  278. filetxt.forEach(async (item) => {
  279. selectedURL = linkConfig.displays[6] == 'checked' && item.medias.length > 0 ? item.medias[0].url : item.link;
  280. if (dataType.match('aria2')) {
  281. return
  282. }
  283. if (dataType.match('文件链接')) {
  284. nameLinkTxt += `<div style="padding: 5px;"><a class="bleu_a" href=${selectedURL} download=${item.name.replace(/ /g,'_')}>${item.name}</a><span class="bleu_gm">浏览器下载</span></div>`;
  285. }
  286. if (dataType.match('idm')) {
  287. nameLinkTxt += `idman /d "${selectedURL}" /p "${linkConfig.local_path}${item.path}" /f "${item.name}" \nping 127.0.0.1 -n 2 >nul\n`;
  288. }
  289. if (dataType.match('curl')) {
  290. nameLinkTxt += `echo 正在下载这个文件:&echo "${linkConfig.local_path}${item.path}${OSflag}${item.name}"&curl -L "${selectedURL}" -o "${linkConfig.local_path}${item.path}${OSflag}${item.name}"\n\n`;
  291. }
  292. if (dataType.match('Xdown')) {
  293. nameLinkTxt += `aria2c "${selectedURL}" --dir "${linkConfig.local_path}${item.path}" --out "${item.name}"\n`;
  294. }
  295. if (dataType.match('播放')) {
  296. mediaIndex = linkConfig.quality[0] === '' ? item.medias.length - 1 : 0;
  297. nameLinkTxt += `#EXTINF:-1 ,${item.name}\n${item.medias[mediaIndex].url}\n`;
  298. }
  299. });
  300. if(dataType.match('显示')){
  301. tools.swalForUI('显示文件链接',nameLinkTxt,'550px');
  302. $('.bleu_gm').on('click', function (e) {
  303. GM_download({
  304. url: e.target.previousElementSibling.getAttribute('href'),
  305. name: e.target.previousElementSibling.getAttribute('download')
  306. });
  307. })
  308. }
  309. else if (dataType.match('复制')) {
  310. new ClipboardJS('.btn_bleu.xdown', {
  311. text: function () {
  312. return nameLinkTxt;
  313. }
  314. });
  315. tools.swalForInfo('复制链接成功!', 1000, 'top-end');
  316. } else if (dataType.match('aria2')) {
  317. main.sendDataToAria();
  318. } else {
  319. let filenam = `${dataType.replace('.txt','')}${(new Date()).valueOf()}.txt`;
  320. if (dataType.match('播放')) {
  321. main.putDataToJGY(filenam, nameLinkTxt);
  322. } else {
  323. tools._downFlie(filenam, nameLinkTxt);
  324. }
  325. }
  326. },
  327. async sendDataToAria() {
  328. let swalTitle = `导入成功,请到aria2客户端查看任务!`,selectedURL;
  329. for (let index = 0; index < filetxt.length; index++) {
  330. try {
  331. selectedURL = linkConfig.displays[6] == 'checked' && filetxt[index].medias.length > 0 ? filetxt[index].medias[0].url : filetxt[index].link;
  332. if (linkConfig.displays[7] == '') {
  333. await main.sendDataByRPC(index, selectedURL);
  334. } else { //使用ariaNg发送
  335. let timedelay = 100;
  336. if (!window.ariaNgUI || window.ariaNgUI.closed) {
  337. window.ariaNgUI = window.open(`http://ariang.js.org/#!/settings/rpc/set/${linkConfig.aria2.ip.split('://')[0]}/${linkConfig.aria2.ip.split('://')[1]}/${linkConfig.aria2.port}/jsonrpc/${btoa(linkConfig.aria2.token)}`, '_blank');
  338. timedelay = 2000; //不延迟,不能修改rpc配置
  339. }
  340. setTimeout(() => {
  341. window.ariaNgUI == null ? swalTitle = `导入失败,ariaNg页面被拦截了!` : swalTitle;
  342. window.ariaNgUI.location.href = `http://ariang.js.org/#!/new/task?url=${window.btoa(selectedURL)}&out=${encodeURIComponent(filetxt[index].name)}&dir=${encodeURIComponent(linkConfig.local_path)}${encodeURIComponent(filetxt[index].path)}`;
  343. }, timedelay)
  344. }
  345. } catch (error) {
  346. console.log(error.responseText);
  347. swalTitle.match('成功') ? swalTitle = `导入失败,确认配置aria2没问题!` : swalTitle;
  348. break;
  349. }
  350. }
  351. tools.swalForInfo(swalTitle, 3000, 'top-end');
  352. },
  353. sendDataByRPC(index, selectedURL) {
  354. let jsonData = {
  355. id: new Date().getTime(),
  356. jsonrpc: '2.0',
  357. method: 'aria2.addUri',
  358. params: [`token:${linkConfig.aria2.token}`, [selectedURL], {
  359. dir: linkConfig.local_path + filetxt[index].path,
  360. out: filetxt[index].name
  361. }]
  362. }
  363. jsonData = JSON.stringify(jsonData);
  364. return tools.bleuAjax('post', `${linkConfig.aria2.ip}:${linkConfig.aria2.port}/jsonrpc`, jsonData,'');
  365. },
  366. //将播放列表存入坚果云
  367. putDataToJGY(filenam, nameLinkTxt) {
  368. if (linkConfig.jgy.account == '') {
  369. filenam = `迅雷云盘播放列表.m3u`;
  370. tools._downFlie(filenam, nameLinkTxt);
  371. } else {
  372. let url = `https://dav.jianguoyun.com/dav/${linkConfig.jgy.path}/xlPlaylist.m3u`;
  373. let header = {"authorization": `Basic ${btoa(linkConfig.jgy.account+':'+linkConfig.jgy.password)}`};
  374. tools.bleuAjax('put',url , nameLinkTxt,header).then(
  375. (value)=>{
  376. value.status === 204?tools.swalForInfo("导入到坚果云成功!", 3000, 'top-end'):tools.swalForInfo("导入到坚果云失败!", 3000, 'top-end')
  377. },
  378. ()=>{tools.swalForInfo("导入到坚果云失败!", 3000, 'top-end')});
  379. }
  380. },
  381. hookFetch() {
  382. Object.defineProperty(unsafeWindow, "fetch", {
  383. configurable: true,
  384. enumerable: true,
  385. // writable: true,
  386. get() {
  387. return (url, options) => {
  388. if (url.indexOf('https://api-pan.xunlei.com/drive/v1/files?limit=100&') === 0) {
  389. filesURL = url;
  390. reqHeaders = options.headers;
  391. }
  392. return originFetch(url, options)
  393. }
  394. }
  395. })
  396. },
  397. getHeaders() {
  398. reqHeaders={};
  399. reqHeaders.withCredentials = false;
  400. reqHeaders['content-type'] = 'application/json';
  401. for (let key in localStorage) {
  402. let temp = localStorage.getItem(key)
  403. if (key.indexOf('credentials') === 0) {
  404. reqHeaders.Authorization = JSON.parse(temp).token_type + ' ' + JSON.parse(temp).access_token;
  405. reqHeaders.clientid = key.substring(key.indexOf('_') + 1);
  406. }
  407. if (key.indexOf('captcha') === 0)
  408. reqHeaders['x-captcha-token'] = JSON.parse(temp).token
  409. if (key === 'deviceid')
  410. reqHeaders['x-device-id'] = temp.substring(temp.indexOf('.') + 1, 32 + temp.indexOf('.') + 1)
  411. }
  412. },
  413. initUI() {
  414. let observer = new MutationObserver(function (mutationsList) {
  415. for (let mutation of mutationsList) {
  416. if (mutation.type === 'childList') {
  417. if (mutation.target.querySelector('.pan-wrapper-asider') && $('#bleu_btn').length == 0) {
  418. main.addElements();
  419. main.addButtonEvent();
  420. break;
  421. }
  422. }
  423. }
  424. });
  425. observer.observe($('#__layout')[0], {
  426. childList: true,
  427. subtree: true,
  428. });
  429. if(location.href.indexOf('/s/')>0){
  430. tools.swalForInfo(`❗不支持此页面,请先保存到云盘`, '', 'top-end')
  431. }
  432. },
  433. }
  434. let tools = {
  435. cssStyle: `
  436. .btn_bleu{width: 250px;font-size: 20px;padding: 10px 25px;cursor: pointer;text-align: center;text-decoration: none;outline: none;color: #fff;background-color: #2670ea;border: none;border-radius: 100px;display:block;margin:12px auto}
  437. .btn_bleu:hover{background-color: #3F85FE;box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);}
  438. .btn_bleu:active{background-color: #3F85FE;box-shadow: 0 5px #666;transform: translateY(4px)}
  439. .bleu_sa_close {width: 30px;height: 30px;font-size: 30px;}
  440. .bleu_sa_title {font-size: 25px;}
  441. .bleu_sa_container{margin: 0;font-size: 20px;}
  442. .bleu_sa_popup {padding: 0 0 0;}
  443. .bleu_a{text-decoration: underline;font-size: 16px;white-space: nowrap;background: linear-gradient(to right, red, blue);-webkit-background-clip: text;color: transparent;display: inline-block;width: 400px;}
  444. .bleu_a:hover{color: #3F85FE}
  445. .bleu_sa_footer{margin: 0;padding-top: 20px;}
  446. .bleu_sa_title_min{font-size: 20px !important;padding: 0;}
  447. .bleu_sa_popup_min{padding: 0 0 0;width: auto;}
  448. .bleu_config{position: absolute;left: 5%;bottom: 10%;width: 60px;height: 60px;line-height: 60px;border-radius: 50%;cursor: pointer;font-size: 13px;background-color: #2670ea;color: #fff;text-align: center;}
  449. .bleu_config:hover{background-color: #3F85FE}
  450. .bleu_config_item{border-radius: 10px;font-size: 20px;margin: 12px 50px;color: #fff;background-color: #3F85FE;box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);}
  451. .bleu_config_item label{font-size: 15px}
  452. .bleu_config_item input.bleu_inp{margin: 0px 10px;font-size: 15px;}
  453. .bleu_config_item input.td-checkbox__inner{margin: 0px 10px 0px 0px}
  454. .bleu_inp{width:60%}
  455. .bleu_config_item p{text-align: left;margin: 0px 20px;}
  456. .bleu_gm{margin-left: 10px;font-size: 14px;background-color: #2670ea;color: white;border-radius: 5%;padding: 5px 10px;}
  457. .bleu_gm:hover{background-color: #3F85FE;box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);}
  458. .bleu_gm:active{background-color: #3F85FE;box-shadow: 0 5px #666;transform: translateY(4px)}
  459. #bleu_select{margin: 0px 10px;background-color: #3F85FE;font-size: 15px;border: none;}
  460. `,
  461. swalHtml: function () {
  462. return `<div><input type="button" style="display:${linkConfig.displays[0]==='checked'?'block':'none'}" class="btn_bleu" value="显示文件链接"></input></div>
  463. <div><input type="button" style="display:${linkConfig.displays[1]==='checked'?'block':'none'}" class="btn_bleu xdown" value="复制idm下载链接"></input></div>
  464. <div><input type="button" style="display:${linkConfig.displays[2]==='checked'?'block':'none'}" class="btn_bleu" value="curl下载.txt"></input></div>
  465. <div><input type="button" style="display:${linkConfig.displays[3]==='checked'?'block':'none'}" class="btn_bleu xdown" value="复制Xdown下载链接"></input></div>
  466. <div><input type="button" style="display:${linkConfig.displays[4]==='checked'?'block':'none'}" class="btn_bleu" value="基于aria2发送RPC任务"></input></div>
  467. <div><input type="button" style="display:${linkConfig.displays[5]==='checked'?'block':'none'}" class="btn_bleu" value="导出播放列表"></input></div>
  468. <a class="bleu_a" href="https://gf.qytechs.cn/zh-CN/scripts/431256" target="_blank">按钮功能说明</a>
  469. `
  470. },
  471. swalConfig: function () {
  472. return `<div class="bleu_config_item"><b>本地下载路径</b>
  473. <p><label>目录</label><input type="text" class="bleu_inp" id="config_path" value="${linkConfig.local_path}"/></p>
  474. </div>
  475. <div class="bleu_config_item"><b>功能按钮显示</b>
  476. <p><input type="checkbox" ${linkConfig.displays[0]} class="td-checkbox__inner bleu"></input><label>显示“显示文件链接”</label></p>
  477. <p><input type="checkbox" ${linkConfig.displays[1]} class="td-checkbox__inner bleu"></input><label>显示“复制idm下载链接”</label></p>
  478. <p><input type="checkbox" ${linkConfig.displays[2]} class="td-checkbox__inner bleu"></input><label>显示“curl下载.txt”</label></p>
  479. <p><input type="checkbox" ${linkConfig.displays[3]} class="td-checkbox__inner bleu"></input><label>显示“复制Xdown下载链接”</label></p>
  480. <p><input type="checkbox" ${linkConfig.displays[4]} class="td-checkbox__inner bleu"></input><label>显示“基于aria2发送RPC任务”</label></p>
  481. <p><input type="checkbox" ${linkConfig.displays[5]} class="td-checkbox__inner bleu"></input><label>显示“导出播放列表”</label></p>
  482. </div>
  483. <div class="bleu_config_item"><b>配置aria2任务</b>
  484. <p><input type="checkbox" index="7" ${linkConfig.displays[7]} class="td-checkbox__inner bleucb"></input><label>通过ariaNg远程发送任务</label></p>
  485. <p><label>地址</label><input type="text" class="bleu_inp" id="config_ip" value="${linkConfig.aria2.ip}"/></p>
  486. <p><label>端口</label><input type="text" class="bleu_inp" id="config_port" value="${linkConfig.aria2.port}"/></p>
  487. <p><label>密钥</label><input type="text" class="bleu_inp" id="config_token" value="${linkConfig.aria2.token}"/></p>
  488. </div>
  489. <div class="bleu_config_item"><b>播放列表设置</b>
  490. <p><label>画质选择</label><select id="bleu_select">
  491. <option value="highlow" ${linkConfig.quality[0]}>从高到低</option>
  492. <option value="lowhigh" ${linkConfig.quality[1]}>从低到高</option>
  493. </select></p>
  494. <b>列表存坚果云</b>
  495. <p><label>文件夹</label><input type="text" class="bleu_inp" id="jgy_path" value="${linkConfig.jgy.path}"/></p>
  496. <p><label>账户</label><input type="text" class="bleu_inp" id="jgy_account" value="${linkConfig.jgy.account}"/></p>
  497. <p><label>授权密码</label><input type="text" class="bleu_inp" id="jgy_password" value="${linkConfig.jgy.password}"/></p>
  498. </div>
  499. <div class="bleu_config_item"><b>视频专用下载</b>
  500. <p><input type="checkbox" index="6" ${linkConfig.displays[6]} class="td-checkbox__inner bleucb"></input><label>勾选此项,不下载源文件,下载云播最高清晰度视频。</label></p>
  501. </div>`
  502. },
  503. swalForUI: function (title, html,width) {
  504. return swal.fire({
  505. title: title,
  506. html: html,
  507. width: width,
  508. showConfirmButton: false,
  509. showCloseButton: true,
  510. allowOutsideClick: false,
  511. footer: ' ',
  512. customClass: {
  513. title: 'bleu_sa_title',
  514. popup: 'bleu_sa_popup',
  515. closeButton: 'bleu_sa_close',
  516. htmlContainer: 'bleu_sa_container',
  517. footer: 'bleu_sa_footer'
  518. },
  519. })
  520. },
  521. swalForInfo: function (satitle, satime, saposition) {
  522. return Swal.fire({
  523. title: satitle,
  524. position: saposition,
  525. showConfirmButton: false,
  526. timer: satime,
  527. customClass: {
  528. title: 'bleu_sa_title_min',
  529. popup: 'bleu_sa_popup_min'
  530. }
  531. })
  532. },
  533. bleuAjax: function (TYPE, URL, DATA,HEADER) {
  534. return new Promise((resolve, reject) => {
  535. GM_xmlhttpRequest({
  536. method: TYPE,
  537. timeout: 2000,
  538. headers: HEADER||reqHeaders,
  539. url: URL,
  540. data: DATA,
  541. dataType: "json",
  542. onload: function (res) {
  543. resolve(JSON.parse(res.response||null)||res.response||res);
  544. },
  545. onerror: function (err) {
  546. reject(JSON.parse(err.response||null)||err.response||err);
  547. },
  548. ontimeout:function(err){
  549. reject(err);
  550. }
  551. });
  552. })
  553. },
  554. _downFlie(fnmae, data) {
  555. let elementA = document.createElement('a');
  556. elementA.download = fnmae;
  557. elementA.style.display = 'none';
  558. let blob = new Blob([data]);
  559. elementA.href = URL.createObjectURL(blob);
  560. document.body.appendChild(elementA);
  561. elementA.click();
  562. document.body.removeChild(elementA);
  563. },
  564. platform() {
  565. OSflag = "\\";
  566. if (linkConfig.local_path.indexOf("/") >= 0) {
  567. OSflag = "/";
  568. }
  569. }
  570. }
  571. window.onunload = () => {
  572. window.ariaNgUI && window.ariaNgUI.close();
  573. };
  574. //main.hookFetch();
  575. main.addCssStyle();
  576. tools.platform();
  577. main.initUI();
  578. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址