蓝奏云自动下载

蓝奏云跳过手动验证并自动下载, 可配置自动关闭页面

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

QingJ © 2025

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