(i)
| 434 | |
| 435 | |
| 436 | function getUrl(i) { |
| 437 | //console.log(i) |
| 438 | GM_xmlhttpRequest({ |
| 439 | url: 'https://pc.woozooo.com/doupload.php', |
| 440 | method: 'POST', |
| 441 | data: tmep_data[i][1], |
| 442 | responseType: 'json', |
| 443 | overrideMimeType: 'application/json; charset=utf-8', |
| 444 | headers: { |
| 445 | 'Referer': mainframe.document.location.href, |
| 446 | 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' |
| 447 | }, |
| 448 | timeout: 5000, |
| 449 | onload: function (response) { |
| 450 | try { |
| 451 | //console.log('返回内容:',response.response) |
| 452 | if (response.response && response.response.zt === 1) { |
| 453 | //console.log(response.response) |
| 454 | if (response.response.info.f_id) { |
| 455 | //console.log('文件 1',f_data) |
| 456 | f_data += `${tmep_data[i][0]} ` |
| 457 | if (menu_value('menu_customFileSha')) { |
| 458 | f_data += `https://${menu_value('menu_customFileSha')}/${response.response.info.f_id} ` |
| 459 | } else { |
| 460 | f_data += `${response.response.info.is_newd}/${response.response.info.f_id} ` |
| 461 | } |
| 462 | if (response.response.info.onof == '1') f_data += `密码:${response.response.info.pwd}` |
| 463 | f_data += `\n` |
| 464 | //console.log('文件 2',f_data) |
| 465 | } else { |
| 466 | //console.log('目录 1',f_data) |
| 467 | f_data += `${response.response.info.name} ` |
| 468 | if (menu_value('menu_customFileSha')) { |
| 469 | f_data += `${response.response.info.new_url.replace(/\/\/.+\//i, '//' + menu_value('menu_customFileSha') + '/')} ` |
| 470 | } else { |
| 471 | f_data += `${response.response.info.new_url} ` |
| 472 | } |
| 473 | if (response.response.info.onof == '1') f_data += `密码:${response.response.info.pwd}` |
| 474 | f_data += `\n` |
| 475 | //console.log('目录 2',f_data) |
| 476 | } |
| 477 | if (++i < tmep_data.length) { |
| 478 | setTimeout(function(){getUrl(i);}, 300); |
| 479 | } else { |
| 480 | console.log(f_data) |
| 481 | GM_setClipboard(f_data, 'text'); |
| 482 | GM_notification({text: '✅ 已复制所有文件/目录的分享链接到剪切板~', timeout: 2000}); |
| 483 | } |
| 484 | } else { |
| 485 | GM_notification({text: '❌ 更新失败,请联系作者解决...', timeout: 5000}); |
| 486 | } |
| 487 | } catch (e) { |
| 488 | console.log(e); |
| 489 | } |
| 490 | } |
| 491 | }) |
| 492 | } |
| 493 | } |
no test coverage detected