Greasy Fork is available in English.

网盘精灵

网盘精灵,云盘、网盘搜索工具,提供了资源搜索功能,支持百度云盘、新浪微盘、蓝奏云盘,城通网盘,彩云网盘,天翼云盘的提取码获取,自动填充,为你提供便捷的资源搜索服务。

  1. // ==UserScript==
  2. // @name 网盘精灵
  3. // @version 1.0.8
  4. // @description 网盘精灵,云盘、网盘搜索工具,提供了资源搜索功能,支持百度云盘、新浪微盘、蓝奏云盘,城通网盘,彩云网盘,天翼云盘的提取码获取,自动填充,为你提供便捷的资源搜索服务。
  5. // @license AGPL
  6. // @match *://pan.baidu.com/*
  7. // @match *://yun.baidu.com/*
  8. // @match *://*.lanzoux.com/*
  9. // @match *://*.lanzous.com/*
  10. // @match *://*.lanzoui.com/*
  11. // @match *://vdisk.weibo.com/*
  12. // @match *://pan.ishare1.cn/file/*
  13. // @match *://sn9.us/file/*
  14. // @match *://545c.com/file/*
  15. // @match *://474b.com/file/*
  16. // @match *://n802.com/file/*
  17. // @match *://t00y.com/file/*
  18. // @match *://caiyun.139.com/*
  19. // @match *://cloud.189.cn/*
  20. // @require https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js
  21. // @require https://cdn.jsdelivr.net/npm/sweetalert2@10.10.0/dist/sweetalert2.all.min.js
  22. // @connect *
  23. // @run-at document-idle
  24. // @antifeature tracking We use the URL to get the extract code
  25. // @namespace https://greasyfork.org/users/215071
  26. // ==/UserScript==
  27.  
  28. ;(() => {
  29.  
  30. 'use strict'
  31.  
  32. let Toast = Swal.mixin({
  33. toast: true,
  34. position: 'top',
  35. showConfirmButton: false,
  36. timer: 3000,
  37. timerProgressBar: false,
  38. onOpen: (toast) => {
  39. toast.addEventListener('mouseenter', Swal.stopTimer)
  40. toast.addEventListener('mouseleave', Swal.resumeTimer)
  41. }
  42. })
  43.  
  44. function search() {
  45. document.querySelector('#search').addEventListener('click', function () {
  46. if (window.document.querySelector('#searchValue').value != "") {
  47. var searchValue = document.querySelector('#searchValue').value;
  48. window.open("https://feiyu100.cn/search?q=" + searchValue)
  49. } else {
  50. window.open("https://feiyu100.cn/home")
  51. }
  52. });
  53. }
  54.  
  55. var apiBase = 'https://pansoapi.feiyu100.cn';
  56.  
  57. //百度网盘 获取提取码
  58. if ((window.location.href.indexOf('init') >= 0 && window.location.href.indexOf('pan.baidu.com') >= 0)
  59. || (window.location.href.indexOf('init') >= 0 && window.location.href.indexOf('yun.baidu.com') >= 0)) {
  60. var link = window.location.href;
  61. window.localStorage.setItem('link', link);
  62.  
  63. $.ajax({
  64. url: `${apiBase}/api/index/getCodeFromUrl`,
  65. method: "POST",
  66. data: {
  67. link: link,
  68. },
  69. success: function (data) {
  70. console.log(data);
  71. if (data.status === 100) {
  72. if (data.data.length > 0) {
  73. //填充提取码
  74. document.querySelector('#accessCode').value = data.data;
  75.  
  76. //插入提示
  77. Toast.fire({
  78. icon: 'success',
  79. text: '获取提取码成功!'
  80. })
  81. } else {
  82. //插入提示
  83. Toast.fire({
  84. icon: 'error',
  85. text: '未能找到提取码!'
  86. })
  87. }
  88. }
  89. },
  90. error: function (e) {
  91. console.log("发生异常" + e);
  92. },
  93. });
  94. if (window.document.querySelectorAll("#doc").length > 0) {
  95. var doc = document.querySelector('#doc');
  96. var panel = document.createElement('div');
  97. panel.innerHTML = `
  98. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;margin-top:50px;">
  99. <input class="QKKaIE LxgeIt" id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字">
  100. <div>
  101. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  102. </div>
  103. </div>
  104. `;
  105. doc.appendChild(panel);
  106. }
  107.  
  108. document.querySelector('#search').addEventListener('click', function () {
  109. if (window.document.querySelector('#searchValue').value != "") {
  110. var searchValue = document.querySelector('#searchValue').value;
  111. window.open("https://feiyu100.cn/search?q=" + searchValue)
  112. } else {
  113. window.open("https://feiyu100.cn/home")
  114. }
  115. });
  116. //监听点击提取按钮,存储提取码
  117. document.querySelector('#submitBtn a').addEventListener('click', function () {
  118. var code = document.getElementById('accessCode').value;
  119. if (code) {
  120. localStorage.setItem(link, code);
  121. }
  122. });
  123. }
  124.  
  125.  
  126. //微盘
  127. if (window.location.href.indexOf("vdisk.weibo.com") >= 0) {
  128. if (window.document.querySelectorAll('.my_vdisk_main').length > 0) {
  129. var vipanel = document.createElement('div');
  130. vipanel.innerHTML = `
  131. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;">
  132. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  133. <div>
  134. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  135. </div>
  136. </div>
  137. `;
  138. var vidiv = document.querySelector('.breadcrumb');
  139. vidiv.parentNode.insertBefore(vipanel, vidiv);
  140. } else {
  141. var vipanel2 = document.createElement('div');
  142. vipanel2.innerHTML = `
  143. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;">
  144. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  145. <div>
  146. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  147. </div>
  148. </div>
  149. `;
  150. var vidiv2 = document.querySelector('.vdmain_part');
  151. vidiv2.parentNode.insertBefore(vipanel2, vidiv2);
  152. }
  153.  
  154.  
  155. document.querySelector('#search').addEventListener('click', function () {
  156. if (window.document.querySelector('#searchValue').value != "") {
  157. var searchValue = document.querySelector('#searchValue').value;
  158. window.open("https://feiyu100.cn/search?q=" + searchValue)
  159. } else {
  160. window.open("https://feiyu100.cn/home")
  161. }
  162. });
  163. var wbLink = '';
  164. var wbExtractCode = '';
  165. var wbTitle = '';
  166. var dirStruct = {
  167. name: '',
  168. size: '',
  169. };
  170. var wbDirStruct = [];
  171. var wbShareTime = '';
  172. var wbTotalSize = '';
  173. window.onload = function () {
  174. var interval = setInterval(function () {
  175. if (window.document.querySelectorAll('.page_down_filename').length > 0
  176. || window.document.querySelectorAll('.page_down_filename').length > 0) {
  177. clearInterval(interval);
  178. wbLink = window.location.href;
  179. if (window.document.querySelector('.btn_vdisk_size')) {
  180. wbTotalSize = window.document.querySelector('.btn_vdisk_size').innerHTML;
  181. } else {
  182. wbTotalSize = '';
  183. }
  184.  
  185. //文件夹
  186. if (window.document.querySelector('.scroll_content')) {
  187. for (let i = 0; i < document.querySelectorAll('#fileListBody tr').length; i++) {
  188. var obj = {
  189. name: '',
  190. size: '',
  191. };
  192. obj.name = window.document.querySelectorAll('.sort_name_intro a')[i].innerText;
  193. if (window.document.querySelectorAll('.sort_size_m')[i].innerText) {
  194. obj.size = window.document.querySelectorAll('.sort_size_m')[i].innerText;
  195. } else {
  196. obj.size = '-';
  197. }
  198. wbDirStruct.push(obj)
  199.  
  200. wbTitle = window.document.querySelector('.page_down_filename').innerText;
  201. }
  202. } else { //不是文件夹
  203. wbTitle = window.document.querySelector('.page_down_filename').innerHTML;
  204. dirStruct.name = window.document.querySelector('.page_down_filename').innerHTML;
  205. dirStruct.size = window.document.querySelector('.btn_vdisk_size').innerHTML;
  206. wbDirStruct.push(dirStruct);
  207. }
  208. }
  209. })
  210. }
  211. }
  212.  
  213.  
  214. //蓝奏云
  215. if (window.location.href.indexOf('lanzou') >= 0) {
  216. var lzTitle = '';
  217. var lzLink = '';
  218. var lzExtractCode = '';
  219. var lzDirStructItem = {
  220. name: '',
  221. size: '',
  222. };
  223. var lzDirStruct = [];
  224. var lzShareTime = '';
  225. var lzTotalSize = '';
  226. var code = '';
  227. //获取提取码
  228. $.ajax({
  229. url: `${apiBase}/api/index/getCodeFromUrl`,
  230. method: "POST",
  231. data: {
  232. link: window.location.href,
  233. },
  234. success: function (data) {
  235. console.log(data);
  236. if (data.status === 100) {
  237. code = data.data;
  238. if (window.document.querySelectorAll('#pwd').length > 0) {
  239. if (window.document.querySelectorAll('#pwdload').length > 0) { //多文件
  240. if (data.data.length > 0) {
  241. window.document.querySelector('#pwd').value = data.data;
  242. Toast.fire({
  243. icon: 'success',
  244. text: '获取提取码成功!'
  245. })
  246. } else {
  247. Toast.fire({
  248. icon: 'error',
  249. text: '未能找到提取码!'
  250. })
  251. }
  252. } else { //单文件
  253. if (data.data.length > 0) {
  254. window.document.querySelector('#pwd').value = data.data;
  255. Toast.fire({
  256. icon: 'success',
  257. text: '获取提取码成功!'
  258. })
  259. } else {
  260. Toast.fire({
  261. icon: 'error',
  262. text: '未能找到提取码!'
  263. })
  264. }
  265. }
  266. } else {
  267. console.log('无需提取码');
  268. }
  269. }
  270. },
  271. error: function (e) {
  272. console.log("发生异常" + e)
  273. },
  274. });
  275.  
  276.  
  277. if (window.document.querySelectorAll('.passwddiv-input .passwddiv-btn').length > 0) { //单文件(有提取码)
  278. var file = document.querySelector('#passwddiv');
  279. var ele = document.createElement('div');
  280. ele.innerHTML = `
  281. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:30px;">
  282. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  283. <div>
  284. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  285. </div>
  286. </div>
  287. `;
  288. file.appendChild(ele);
  289.  
  290. document.querySelector('#search').addEventListener('click', function () {
  291. if (window.document.querySelector('#searchValue').value != "") {
  292. var searchValue = document.querySelector('#searchValue').value;
  293. window.open("https://feiyu100.cn/search?q=" + searchValue)
  294. } else {
  295. window.open("https://feiyu100.cn/home")
  296. }
  297. });
  298.  
  299. window.document.querySelector('.passwddiv-input .passwddiv-btn').addEventListener('click', function () {
  300. var lzpanel = document.createElement('div');
  301. lzpanel.innerHTML = `
  302. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:70px;position:relative;">
  303. <input id="searchValue1" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  304. <div>
  305. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  306. </div>
  307. </div>
  308. `;
  309. var lzdiv = document.querySelector('.n_box');
  310. lzdiv.parentNode.insertBefore(lzpanel, lzdiv);
  311.  
  312. document.querySelector('#search').addEventListener('click', function () {
  313. if (window.document.querySelector('#searchValue1').value != "") {
  314. var searchValue = document.querySelector('#searchValue1').value;
  315. window.open("https://feiyu100.cn/search?q=" + searchValue)
  316. } else {
  317. window.open("https://feiyu100.cn/home")
  318. }
  319. });
  320.  
  321. window.localStorage.setItem(window.location.href, window.document.querySelector('#pwd').value);
  322. window.localStorage.setItem('lzLink', window.location.href);
  323. var a = setInterval(function () {
  324. if (window.document.querySelector('#filenajax').innerText && window.document.querySelector('#filenajax').innerText != "文件") {
  325. clearInterval(a);
  326. if (window.location.href === window.localStorage.getItem('lzLink')) {
  327. lzExtractCode = window.localStorage.getItem(window.localStorage.getItem('lzLink'));
  328. } else {
  329. lzExtractCode = '';
  330. }
  331. if (window.document.querySelector('#file')) {
  332. lzTitle = window.document.querySelector('#filenajax').innerText;
  333. lzLink = window.location.href;
  334. if (window.document.querySelector('.n_file_info span.n_file_infos').innerText) {
  335. lzShareTime = window.document.querySelector('.n_file_info span.n_file_infos').innerText;
  336. } else {
  337. lzShareTime = '';
  338. }
  339. if (window.document.querySelector('.n_filesize').innerText) {
  340. lzTotalSize = window.document.querySelector('.n_filesize').innerText.match(/大小:(\S*)/)[1];
  341. lzDirStructItem.name = window.document.querySelector('#filenajax').innerText;
  342. lzDirStructItem.size = window.document.querySelector('.n_filesize').innerText.match(/大小:(\S*)/)[1];
  343. lzDirStruct.push(lzDirStructItem);
  344. } else {
  345. lzTotalSize = '';
  346. lzDirStructItem.name = window.document.querySelector('#filenajax').innerText;
  347. lzDirStructItem.size = '-';
  348. lzDirStruct.push(lzDirStructItem);
  349. }
  350. }
  351.  
  352. }
  353. }, 1);
  354. });
  355. } else if (window.document.querySelector('.btnpwd#sub')) { //多文件(有提取码)
  356. var lzpanel2 = document.createElement('div');
  357. lzpanel2.innerHTML = `
  358. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;">
  359. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  360. <div>
  361. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  362. </div>
  363. </div>
  364. `;
  365. var lzdiv2 = document.querySelector('#pwdload');
  366. lzdiv2.parentNode.insertBefore(lzpanel2, lzdiv2);
  367.  
  368.  
  369. document.querySelector('#search').addEventListener('click', function () {
  370. if (window.document.querySelector('#searchValue').value != "") {
  371. var searchValue = document.querySelector('#searchValue').value;
  372. window.open("https://feiyu100.cn/search?q=" + searchValue)
  373. } else {
  374. window.open("https://feiyu100.cn/home")
  375. }
  376. });
  377. window.document.querySelector('.btnpwd#sub').addEventListener('click', function () {
  378. window.localStorage.setItem(window.location.href, window.document.querySelector('#pwd').value);
  379. window.localStorage.setItem('lzLink', window.location.href);
  380. var interval = setInterval(function () {
  381. if (window.document.querySelectorAll('.d div#sp_name').length > 0 && window.document.querySelectorAll('#infos #name a').length > 0) {
  382. clearInterval(interval);
  383. if (window.location.href === window.localStorage.getItem('lzLink')) {
  384. lzExtractCode = window.localStorage.getItem(window.localStorage.getItem('lzLink'));
  385. } else {
  386. lzExtractCode = '';
  387. }
  388. lzTitle = window.document.querySelector('.d div#sp_name').innerText;
  389. lzLink = window.location.href;
  390. lzTotalSize = '';
  391. lzDirStructItem.name = window.document.querySelector('#infos #name a').innerText;
  392. if (window.document.querySelector('#infos #size').innerText) {
  393. lzDirStructItem.size = window.document.querySelector('#infos #size').innerText;
  394. } else {
  395. lzDirStructItem.size = '-';
  396. }
  397. lzDirStruct.push(lzDirStructItem);
  398. lzShareTime = '';
  399.  
  400. }
  401. }, 1);
  402. });
  403. }
  404. //单文件无提取码
  405. else if (window.document.querySelector('#filenajax').innerText && window.document.querySelector('#filenajax').innerText != "文件") {
  406. var lzpanel = document.createElement('div');
  407. lzpanel.innerHTML = `
  408. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:70px;position:relative;">
  409. <input id="searchValue1" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  410. <div>
  411. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  412. </div>
  413. </div>
  414. `;
  415. var lzdiv = document.querySelector('.n_box');
  416. lzdiv.parentNode.insertBefore(lzpanel, lzdiv);
  417.  
  418. document.querySelector('#search').addEventListener('click', function () {
  419. if (window.document.querySelector('#searchValue1').value != "") {
  420. var searchValue = document.querySelector('#searchValue1').value;
  421. window.open("https://feiyu100.cn/search?q=" + searchValue)
  422. } else {
  423. window.open("https://feiyu100.cn/home")
  424. }
  425. });
  426. var a = setInterval(function () {
  427. if (window.document.querySelector('#filenajax').innerText && window.document.querySelector('#filenajax').innerText != "文件") {
  428. clearInterval(a);
  429. if (window.location.href === window.localStorage.getItem('lzLink')) {
  430. lzExtractCode = window.localStorage.getItem(window.localStorage.getItem('lzLink'));
  431. } else {
  432. lzExtractCode = '';
  433. }
  434. if (window.document.querySelector('#file')) {
  435. lzTitle = window.document.querySelector('#filenajax').innerText;
  436. lzLink = window.location.href;
  437. if (window.document.querySelector('.n_file_info span.n_file_infos').innerText) {
  438. lzShareTime = window.document.querySelector('.n_file_info span.n_file_infos').innerText;
  439. } else {
  440. lzShareTime = '';
  441. }
  442. if (window.document.querySelector('.n_filesize').innerText) {
  443. lzTotalSize = window.document.querySelector('.n_filesize').innerText.match(/大小:(\S*)/)[1];
  444. lzDirStructItem.name = window.document.querySelector('#filenajax').innerText;
  445. lzDirStructItem.size = window.document.querySelector('.n_filesize').innerText.match(/大小:(\S*)/)[1];
  446. lzDirStruct.push(lzDirStructItem);
  447. } else {
  448. lzTotalSize = '';
  449. lzDirStructItem.name = window.document.querySelector('#filenajax').innerText;
  450. lzDirStructItem.size = '-';
  451. lzDirStruct.push(lzDirStructItem);
  452. }
  453. }
  454. lzLink = window.location.href;
  455. lzExtractCode = '';
  456.  
  457. }
  458. }, 1);
  459. } else { //无提取码
  460. var lzpanel3 = document.createElement('div');
  461. lzpanel3.innerHTML = `
  462. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;">
  463. <input id="searchValue2" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  464. <div>
  465. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  466. </div>
  467. </div>
  468. `;
  469. var lzdiv3 = document.querySelector('.d');
  470. lzdiv3.parentNode.insertBefore(lzpanel3, lzdiv3);
  471. document.querySelector('#search').addEventListener('click', function () {
  472. if (window.document.querySelector('#searchValue2').value != "") {
  473. var searchValue = document.querySelector('#searchValue2').value;
  474. window.open("https://feiyu100.cn/search?q=" + searchValue)
  475. } else {
  476. window.open("https://feiyu100.cn/home")
  477. }
  478. });
  479. var lzinterval = setInterval(function () {
  480. if (window.document.querySelectorAll('.d div').length > 0) {
  481. clearInterval(lzinterval);
  482. lzTitle = window.document.querySelector('.d div').innerText;
  483. lzLink = window.location.href;
  484. if (window.document.querySelectorAll('.d2 table td')[0]) {
  485. window.document.querySelectorAll('.d2 table td')[0].innerText.split('\n').forEach(function (item) {
  486. if (item.includes('文件大小')) {
  487. console.log(item);
  488. var length = item.length
  489. lzTotalSize = item.slice(5, length);
  490. console.log(lzTotalSize);
  491. }
  492. })
  493. lzDirStructItem.name = window.document.querySelector('.d div').innerText;
  494. lzDirStructItem.size = lzTotalSize;
  495. lzDirStruct.push(lzDirStructItem);
  496. } else {
  497. lzTotalSize = '-';
  498. lzDirStructItem.name = window.document.querySelector('.d div').innerText;
  499. lzDirStructItem.size = '-';
  500. lzDirStruct.push(lzDirStructItem);
  501. lzShareTime = "";
  502. }
  503. }
  504. }, 1);
  505. }
  506. }
  507.  
  508.  
  509. //城通网盘
  510. if (window.location.href.indexOf('sn9.us/file') >= 0 || window.location.href.indexOf('pan.ishare1.cn/file') >= 0 || window.location.href.indexOf('545c.com/file') >= 0
  511. || window.location.href.indexOf("474b.com/file") >= 0 || window.location.href.indexOf('n802.com/file') >= 0 || window.location.href.indexOf('t00y.com/file') >= 0) {
  512. var ctLink = '';
  513. var ctExtractCode = '';
  514. var ctTitle = '';
  515. var ctDirStructItem = {
  516. name: '',
  517. size: '',
  518. };
  519. var ctDirStruct = [];
  520. var ctShareTime = '';
  521. var ctTotalSize = '';
  522. var ctInterval = setInterval(function () {
  523. if (window.document.querySelectorAll('h4.text-white').length > 0) {
  524. var card = document.querySelector('.card .card-body');
  525. var cardItem = document.createElement('div');
  526. cardItem.innerHTML = `
  527. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;margin-top:10px;">
  528. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;line-height:20px;border-radius:4px;">
  529. <div>
  530. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  531. </div>
  532. </div>
  533. `;
  534. card.appendChild(cardItem);
  535.  
  536. document.querySelector('#search').addEventListener('click', function () {
  537. if (window.document.querySelector('#searchValue').value != "") {
  538. var searchValue = document.querySelector('#searchValue').value;
  539. window.open("https://feiyu100.cn/search?q=" + searchValue)
  540. } else {
  541. window.open("https://feiyu100.cn/home")
  542. }
  543. });
  544. clearInterval(ctInterval);
  545. ctLink = window.location.href;
  546. ctTitle = window.document.querySelector('h4.text-white').innerText.slice(5);
  547. var temp = window.document.querySelectorAll('.fs--1')[1].innerText;
  548. ctTotalSize = temp.split(' ')[0].match(/文件大小(\S*)/)[1] + temp.split(" ")[1];
  549. ctShareTime = temp.split(" ")[2].match(/上传时间(\S*)/)[1];
  550. ctDirStructItem.name = window.document.querySelector('h4.text-white').innerText.slice(5);
  551. ctDirStructItem.size = temp.split(' ')[0].match(/文件大小(\S*)/)[1] + temp.split(" ")[1];
  552. ctDirStruct.push(ctDirStructItem);
  553.  
  554. }
  555. })
  556. }
  557.  
  558.  
  559. //彩云
  560. if (window.location.href.indexOf('caiyun.139.com') >= 0) {
  561. var cyInterval = setInterval(function () {
  562. if (window.document.querySelectorAll('.token-form .btn-token').length > 0 || document.querySelectorAll('#rowlist .list-row').length > 0) {
  563. clearInterval(cyInterval);
  564. var cyLink = '';
  565. var cyExtractCode = '';
  566. var cyTitle = '';
  567. var cyDirStruct = [];
  568. var cyShareTime = '';
  569. var cyTotalSize = '';
  570. //获取彩云链接提取码
  571. $.ajax({
  572. url: `${apiBase}/api/index/getCodeFromUrl`,
  573. method: "POST",
  574. data: {
  575. link: window.location.href,
  576. },
  577. success: function (data) {
  578. if (data.status === 100) {
  579. code = data.data;
  580. if (window.document.querySelectorAll('.token-input-group input').length > 0) {
  581. if (data.data.length > 0) {
  582. document.querySelector('.token-input-group input').value = data.data;
  583. Toast.fire({
  584. icon: 'success',
  585. text: '获取提取码成功!'
  586. })
  587. } else {
  588. Toast.fire({
  589. icon: 'error',
  590. text: '未能找到提取码!'
  591. })
  592. }
  593. } else {
  594. console.log('无需提取码');
  595. }
  596. }
  597. },
  598. error: function (e) {
  599. console.log("发生异常" + e)
  600. },
  601. });
  602.  
  603. if (window.document.querySelectorAll('.token-input-group input').length > 0) { //有提取码
  604. var cypanel = document.createElement('div');
  605. cypanel.innerHTML = `
  606. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:0px;position:relative;">
  607. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  608. <div>
  609. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  610. </div>
  611. </div>
  612. `;
  613. var cydiv = document.querySelector('.token');
  614. cydiv.parentNode.insertBefore(cypanel, cydiv);
  615. search();
  616. document.querySelector('.token-input-group input').addEventListener("input", function (e) {
  617. console.log(e.target.value);
  618. var link = window.location.href;
  619. var code = e.target.value;
  620. window.localStorage.setItem(link, code);
  621. window.localStorage.setItem('cyLink', link);
  622. });
  623. document.querySelector('.btn-token').addEventListener('click', function () {
  624. var cyInterval2 = setInterval(function () {
  625. if (document.querySelectorAll('#rowlist .list-row').length > 0) {
  626. clearInterval(cyInterval2);
  627. if (window.location.href === window.localStorage.getItem('cyLink')) {
  628. cyLink = window.localStorage.getItem('cyLink');
  629. cyExtractCode = window.localStorage.getItem(cyLink);
  630. } else {
  631. cyLink = window.location.href;
  632. cyExtractCode = '';
  633. }
  634. if (document.querySelectorAll('#rowlist .list-row').length > 0) {
  635. for (let i = 0; i < document.querySelectorAll('#rowlist .list-row').length; i++) {
  636. var obj = {
  637. name: '',
  638. size: '',
  639. };
  640. obj.name = document.querySelectorAll('.row-col-name a')[i].innerText;
  641. obj.size = document.querySelectorAll('#rowlist .row-col-4')[i].innerText;
  642. cyDirStruct.push(obj);
  643.  
  644. }
  645. cyTitle = document.querySelectorAll('.row-col-name a')[0].innerText
  646. }
  647. cyShareTime = document.querySelectorAll('.share-info .s_info span')[0].innerText
  648. }
  649. }, 1)
  650. })
  651. }
  652. if (document.querySelectorAll('#rowlist .list-row').length > 0) {
  653. var cypanel1 = document.createElement('div');
  654. cypanel1.innerHTML = `
  655. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:0px;position:relative;">
  656. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  657. <div>
  658. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  659. </div>
  660. </div>
  661. `;
  662. var cydiv1 = document.querySelector('.main-top');
  663. cydiv1.parentNode.insertBefore(cypanel1, cydiv1);
  664. search();
  665. var cyInterval3 = setInterval(function () {
  666. if (document.querySelectorAll('#rowlist .list-row').length > 0) {
  667. clearInterval(cyInterval3);
  668. if (window.location.href === window.localStorage.getItem('cyLink')) {
  669. cyLink = window.localStorage.getItem('cyLink');
  670. cyExtractCode = window.localStorage.getItem(cyLink);
  671. } else {
  672. cyLink = window.location.href;
  673. cyExtractCode = '';
  674. }
  675. if (document.querySelectorAll('#rowlist .list-row').length > 0) {
  676. for (let i = 0; i < document.querySelectorAll('#rowlist .list-row').length; i++) {
  677. var obj = {
  678. name: '',
  679. size: '',
  680. };
  681. obj.name = document.querySelectorAll('.row-col-name a')[i].innerText;
  682. obj.size = document.querySelectorAll('#rowlist .row-col-4')[i].innerText;
  683. cyDirStruct.push(obj);
  684.  
  685. }
  686. cyTitle = document.querySelectorAll('.row-col-name a')[0].innerText;
  687. }
  688. cyShareTime = document.querySelectorAll('.share-info .s_info span')[0].innerText
  689. }
  690. }, 1)
  691. }
  692. }
  693. }, 1)
  694. }
  695.  
  696.  
  697. //天翼云
  698. if (window.location.href.indexOf('cloud.189.cn') >= 0) {
  699. var tyLink = '';
  700. var tyExtractCode = '';
  701. var tyTitle = '';
  702. var tyDirStructItem = {
  703. name: '',
  704. size: '',
  705. }
  706. var tyDirStruct = [];
  707. var tyShareTime = '';
  708. var tyTotalSize = '';
  709.  
  710. //获取提取码
  711. $.ajax({
  712. url: `${apiBase}/api/index/getCodeFromUrl`,
  713. method: "POST",
  714. data: {
  715. link: window.location.href,
  716. },
  717. success: function (data) {
  718. if (data.status === 100) {
  719.  
  720. if (window.document.querySelectorAll('#code_txt').length > 0) {
  721. if (data.data.length > 0) {
  722. window.document.querySelector('#code_txt').value = data.data;
  723.  
  724. Toast.fire({
  725. icon: 'success',
  726. text: '获取提取码成功!'
  727. })
  728. } else {
  729. Toast.fire({
  730. icon: 'error',
  731. text: '未能找到提取码!'
  732. })
  733.  
  734. }
  735. } else {
  736. console.log('无需提取码');
  737. }
  738. }
  739. },
  740. error: function (e) {
  741. console.log("发生异常" + e)
  742. },
  743. });
  744. if (window.document.querySelectorAll('.access-code-item').length > 0) { //有提取码
  745. var typanel = document.createElement('div');
  746. typanel.innerHTML = `
  747. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:60px;position:relative;">
  748. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  749. <div>
  750. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  751. </div>
  752. </div>
  753. `;
  754. var tydiv = document.querySelector('.file-info');
  755. tydiv.parentNode.insertBefore(typanel, tydiv);
  756. search();
  757. window.document.querySelector('.access-code-item a').addEventListener('click', function () {
  758. window.localStorage.setItem(window.location.href, window.document.querySelector('#code_txt').value);
  759. window.localStorage.setItem('tyLink', window.location.href);
  760. var tyInterval = setInterval(function () {
  761. if (window.document.querySelector('.info-detail .title').innerText.length > 0) {
  762. clearInterval(tyInterval);
  763. if (window.location.href === window.localStorage.getItem('tyLink')) {
  764. tyExtractCode = window.localStorage.getItem(window.localStorage.getItem('tyLink'));
  765. } else {
  766. lzExtractCode = '';
  767. }
  768. tyLink = window.location.href;
  769. tyTitle = window.document.querySelector('.info-detail .title span').innerText;
  770. tyDirStructItem.name = window.document.querySelector('.info-detail .title span').innerText;
  771. if (window.document.querySelectorAll('.info-detail .title span').length > 1) {
  772. var length = window.document.querySelectorAll('.info-detail .title span')[1].innerText.length;
  773. tyTotalSize = window.document.querySelectorAll('.info-detail .title span')[1].innerText.slice(1, length - 1);
  774. tyDirStructItem.size = window.document.querySelectorAll('.info-detail .title span')[1].innerText.slice(1, length - 1);
  775. } else {
  776. tyTotalSize = '-';
  777. tyDirStructItem.size = '-';
  778. }
  779. tyDirStruct.push(tyDirStructItem);
  780. var long = window.document.querySelector('#J_ShareDate').innerText.split(" ")[0].length;
  781. tyShareTime = window.document.querySelector('#J_ShareDate').innerText.split(" ")[0].slice(3, long);
  782. }
  783. }, 1);
  784. });
  785. } else if (window.document.querySelector('.outlink-box-s')) {
  786. var typanel2 = document.createElement('div');
  787. typanel2.innerHTML = `
  788. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:60px;position:relative;">
  789. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  790. <div>
  791. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  792. </div>
  793. </div>
  794. `;
  795. var tydiv2 = document.querySelector('.outlink-box-s');
  796. tydiv2.parentNode.insertBefore(typanel2, tydiv2);
  797. search();
  798. var tyInterval2 = setInterval(function () {
  799. if (window.document.querySelector('.outlink-box-s .file-info h1').innerText.length > 0) {
  800. clearInterval(tyInterval2);
  801. if (window.location.href === window.localStorage.getItem('tyLink')) {
  802. tyExtractCode = window.localStorage.getItem(window.localStorage.getItem('tyLink'));
  803. } else {
  804. lzExtractCode = '';
  805. }
  806. tyLink = window.location.href;
  807. tyTitle = window.document.querySelector('.outlink-box-s .file-info h1 span').innerText;
  808. tyDirStructItem.name = window.document.querySelector('.outlink-box-s .file-info h1 span').innerText;
  809. if (window.document.querySelectorAll('.outlink-box-s .file-info h1 span').length > 1) {
  810. var length = window.document.querySelectorAll('.outlink-box-s .file-info h1 span')[1].innerText.length;
  811. tyTotalSize = window.document.querySelectorAll('.outlink-box-s .file-info h1 span')[1].innerText.slice(1, length - 1);
  812. tyDirStructItem.size = window.document.querySelectorAll('.outlink-box-s .file-info h1 span')[1].innerText.slice(1, length - 1);
  813. } else {
  814. tyTotalSize = '-';
  815. tyDirStructItem.size = '-';
  816. }
  817. tyDirStruct.push(tyDirStructItem);
  818. var long = window.document.querySelector('#J_ShareDate').innerText.split(" ")[0].length;
  819. tyShareTime = window.document.querySelector('#J_ShareDate').innerText.split(" ")[0].slice(3, long);
  820. }
  821. }, 1)
  822. } else if (window.document.querySelector('.info-detail .title').innerText.length > 0) {
  823. var typanel3 = document.createElement('div');
  824. typanel3.innerHTML = `
  825. <div class="clearfix input-area" style="width:100%;display:flex;justify-content:center;padding-top:10px;top:0px;position:relative;">
  826. <input id="searchValue" tabindex="1" type="text" placeholder="资源搜索:请输入关键字" style="width:280px;border:1px solid #f2f2f2;padding:8px 10px;height:20px;line-height:20px;border-radius:4px;">
  827. <div>
  828. <button style="width: 100%;height: 100%;background: #09aaff;border: none;color: white;border-radius: 5px;margin: 0 20px;" id="search">搜索</button>
  829. </div>
  830. </div>
  831. `;
  832. var tydiv3 = document.querySelector('.file-info');
  833. tydiv3.parentNode.insertBefore(typanel3, tydiv3);
  834. search();
  835. var tyInterval = setInterval(function () {
  836. if (window.document.querySelector('.info-detail .title').innerText.length > 0) {
  837. clearInterval(tyInterval);
  838. if (window.location.href === window.localStorage.getItem('tyLink')) {
  839. tyExtractCode = window.localStorage.getItem(window.localStorage.getItem('tyLink'));
  840. } else {
  841. lzExtractCode = '';
  842. }
  843. tyLink = window.location.href;
  844. tyTitle = window.document.querySelector('.info-detail .title span').innerText;
  845. tyDirStructItem.name = window.document.querySelector('.info-detail .title span').innerText;
  846. if (window.document.querySelectorAll('.info-detail .title span').length > 1) {
  847. var length = window.document.querySelectorAll('.info-detail .title span')[1].innerText.length;
  848. tyTotalSize = window.document.querySelectorAll('.info-detail .title span')[1].innerText.slice(1, length - 1);
  849. tyDirStructItem.size = window.document.querySelectorAll('.info-detail .title span')[1].innerText.slice(1, length - 1);
  850. } else {
  851. tyTotalSize = '-';
  852. tyDirStructItem.size = '-';
  853. }
  854. tyDirStruct.push(tyDirStructItem);
  855. var long = window.document.querySelector('#J_ShareDate').innerText.split(" ")[0].length;
  856. tyShareTime = window.document.querySelector('#J_ShareDate').innerText.split(" ")[0].slice(3, long);
  857. }
  858. }, 1);
  859. }
  860. }
  861.  
  862. })()
  863.  
  864.  
  865.