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

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

  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.2
  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 *.lanosso.com/*
  39. // @match *.lanzn.com/*
  40. // @match *.lanzog.com/*
  41. // @match *.lanpw.com/*
  42. // @match *.lanpv.com/*
  43. // @match *.lanzv.com/*
  44. // @match *.lanrar.com/file/*
  45. // @grant GM_getValue
  46. // @grant GM_setValue
  47. // ==/UserScript==
  48.  
  49. (
  50. function() {
  51. var defaultClose = false;
  52. var defaultTimeout = 1;
  53. var closeInterval,closeTimeout;
  54. 'use strict';
  55.  
  56. document.getElementById("load2").style.display="none";
  57. //添加倒计时显示
  58. var count = 2;
  59. var countDown = setInterval(function(){
  60. document.getElementById("sub").firstElementChild.innerHTML = "验证并下载 ("+ count.toFixed(1) +"s)";
  61. count=count-0.1;
  62. }, 100);
  63. //倒计时两秒后自动点击验证,自动点击下载
  64. setTimeout(function(){
  65. clearInterval(countDown);
  66. down_r(2);
  67. setTimeout(function(){
  68. window.location.href = document.getElementById("go").firstElementChild.href;
  69. //设置自动关闭下载页面
  70. closePage();
  71. }, 500);
  72. }, 2000);
  73.  
  74. //页面关闭倒计时
  75. var closePage = function(){
  76. if(GM_getValue('doClose', defaultClose)){
  77. let count = GM_getValue('doCloseTimeout', defaultTimeout) * 1;
  78. closeInterval = setInterval(function(){
  79. document.getElementById("countdown").innerHTML = "("+ count.toFixed(1) +"s)";
  80. count=count-0.1;
  81. }, 100);
  82. closeTimeout = setTimeout(function(){
  83. window.close();
  84. }, GM_getValue('doCloseTimeout', defaultTimeout) * 1000);
  85. }
  86. }
  87.  
  88. //配置是否关闭页面
  89. var autoClosed = function(){
  90. if(GM_getValue('doClose', defaultClose) === false){
  91. GM_setValue('doClose', true);
  92. } else{
  93. document.getElementById("countdown").innerHTML = "";
  94. clearInterval(closeInterval)
  95. clearTimeout(closeTimeout)
  96. GM_setValue('doClose', false);
  97. }
  98. }
  99. //配置关闭页面时间
  100. var closeTimeoutChange = function(){
  101. if(!document.getElementById("closeTimeout").value || document.getElementById("closeTimeout").value < 1){
  102. document.getElementById("closeTimeout").value = 1;
  103. }
  104. GM_setValue('doCloseTimeout', document.getElementById("closeTimeout").value);
  105. }
  106.  
  107. //添加是否关闭页面设置以及倒计时设置
  108. var gmSetting = document.createElement('div');
  109. gmSetting.style.position = 'fixed';
  110. gmSetting.style.top = '5%';
  111. gmSetting.style.right = '5%';
  112. 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>'
  113. document.getElementsByTagName("body")[0].append(gmSetting)
  114. document.getElementById("gmSetting").onclick = autoClosed;
  115. document.getElementById("closeTimeout").value = GM_getValue('doCloseTimeout', defaultTimeout);
  116. document.getElementById("closeTimeout").onchange = closeTimeoutChange;
  117. document.getElementById("go").onclick = closePage;
  118. }
  119. )();自动关闭页面

QingJ © 2025

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