藍奏雲自動下載 (修復版)

藍奏雲跳過手動驗證並自動下載, 可配置自動關閉頁面

目前為 2024-01-07 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name LANZOU Auto Download Fix
  3. // @name:zh-CN 蓝奏云自动下载 (修复版)
  4. // @name:zh-TW 藍奏雲自動下載 (修復版)
  5. // @namespace lanzouyun_auto_download_fix
  6. // @version 1.0
  7. // @description 蓝奏云跳过手动验证并自动下载, 可配置自动关闭页面
  8. // @description:zh-CN 蓝奏云跳过手动验证并自动下载, 可配置自动关闭页面
  9. // @description:zh-TW 藍奏雲跳過手動驗證並自動下載, 可配置自動關閉頁面
  10. // @author 狐狸小宮
  11. // @match *.baidupan.com/file/*
  12. // @match *.lanzoua.com/*
  13. // @match *.lanzoub.com/*
  14. // @match *.lanzouc.com/*
  15. // @match *.lanzoud.com/*
  16. // @match *.lanzoue.com/*
  17. // @match *.lanzouf.com/*
  18. // @match *.lanzoug.com/*
  19. // @match *.lanzouh.com/*
  20. // @match *.lanzoui.com/*
  21. // @match *.lanzouj.com/*
  22. // @match *.lanzouk.com/*
  23. // @match *.lanzoul.com/*
  24. // @match *.lanzoum.com/*
  25. // @match *.lanzoun.com/*
  26. // @match *.lanzouo.com/*
  27. // @match *.lanzoup.com/*
  28. // @match *.lanzouq.com/*
  29. // @match *.lanzour.com/*
  30. // @match *.lanzous.com/*
  31. // @match *.lanzout.com/*
  32. // @match *.lanzouu.com/*
  33. // @match *.lanzouv.com/*
  34. // @match *.lanzouw.com/*
  35. // @match *.lanzoux.com/*
  36. // @match *.lanzouy.com/*
  37. // @match *.lanzouz.com/*
  38. // @match *.lanrar.com/file/*
  39. // @grant GM_getValue
  40. // @grant GM_setValue
  41. // ==/UserScript==
  42.  
  43. (
  44. function() {
  45. var defaultClose = false;
  46. var defaultTimeout = 1;
  47. var closeInterval,closeTimeout;
  48. 'use strict';
  49.  
  50. document.getElementById("load2").style.display="none";
  51. //添加倒计时显示
  52. var count = 2;
  53. var countDown = setInterval(function(){
  54. document.getElementById("sub").firstElementChild.innerHTML = "验证并下载 ("+ count.toFixed(1) +"s)";
  55. count=count-0.1;
  56. }, 100);
  57. //倒计时一秒后自动点击验证,自动点击下载
  58. setTimeout(function(){
  59. clearInterval(countDown);
  60. down_r(1);
  61. setTimeout(function(){
  62. window.location.href = document.getElementById("go").firstElementChild.href;
  63. //设置自动关闭下载页面
  64. closePage();
  65. }, 500);
  66. }, 2000);
  67.  
  68. //页面关闭倒计时
  69. var closePage = function(){
  70. if(GM_getValue('doClose', defaultClose)){
  71. let count = GM_getValue('doCloseTimeout', defaultTimeout) * 1;
  72. closeInterval = setInterval(function(){
  73. document.getElementById("countdown").innerHTML = "("+ count.toFixed(1) +"s)";
  74. count=count-0.1;
  75. }, 100);
  76. closeTimeout = setTimeout(function(){
  77. window.close();
  78. }, GM_getValue('doCloseTimeout', defaultTimeout) * 1000);
  79. }
  80. }
  81.  
  82. //配置是否关闭页面
  83. var autoClosed = function(){
  84. if(GM_getValue('doClose', defaultClose) === false){
  85. GM_setValue('doClose', true);
  86. } else{
  87. document.getElementById("countdown").innerHTML = "";
  88. clearInterval(closeInterval)
  89. clearTimeout(closeTimeout)
  90. GM_setValue('doClose', false);
  91. }
  92. }
  93. //配置关闭页面时间
  94. var closeTimeoutChange = function(){
  95. if(!document.getElementById("closeTimeout").value || document.getElementById("closeTimeout").value < 1){
  96. document.getElementById("closeTimeout").value = 1;
  97. }
  98. GM_setValue('doCloseTimeout', document.getElementById("closeTimeout").value);
  99. }
  100.  
  101. //添加是否关闭页面设置以及倒计时设置
  102. var gmSetting = document.createElement('div');
  103. gmSetting.style.position = 'fixed';
  104. gmSetting.style.top = '5%';
  105. gmSetting.style.right = '5%';
  106. gmSetting.innerHTML = '<input id="gmSetting" type="checkbox" name="gm" '+ (GM_getValue('doClose', defaultClose) ? 'checked' : '') +'/> 启动下载<input style="border:none;border-bottom:1px solid;width:50px;text-align:center" id="closeTimeout"/>秒后自动关闭页面<span id="countdown"></span>'
  107. document.getElementsByTagName("body")[0].append(gmSetting)
  108. document.getElementById("gmSetting").onclick = autoClosed;
  109. document.getElementById("closeTimeout").value = GM_getValue('doCloseTimeout', defaultTimeout);
  110. document.getElementById("closeTimeout").onchange = closeTimeoutChange;
  111. document.getElementById("go").onclick = closePage;
  112. }
  113. )();自动关闭页面

QingJ © 2025

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