igg-games 自動轉到檔案下載頁面

不用等待下載時的五秒

  1. // ==UserScript==
  2. // @name igg-games 自動轉到檔案下載頁面
  3. // @namespace http://tampermonkey.net/
  4. // @version 2.2
  5. // @description 不用等待下載時的五秒
  6. // @author BeenYan
  7. // @match http*://bluemediafiles.com/*
  8. // @match http*://bluemediafiles.eu/*
  9. // @match http*://bluemediafiles.homes/*
  10. // @match http*://bluemediafiles.net/*
  11. // @match http*://bluemediafiles.xyz/*
  12. // @match http*://bluemediafile.sbs/*
  13. // @match http*://dl.pcgamestorrents.org/*
  14. // @grant none
  15. // @license GPL
  16. // ==/UserScript==
  17.  
  18. (function() {
  19. 'use strict';
  20. let url = null;
  21. const find_source = () =>{
  22. for (const script of document.getElementsByTagName('script')) {
  23. const matches = /Goroi_n_Create_Button\("(.*)"\)/.exec(script.innerHTML);
  24. if (matches && matches.length === 2) {
  25. return matches[1];
  26. }
  27. }
  28. }
  29.  
  30. const time = setInterval(()=>{
  31. if (url === null) url = find_source();
  32. if (url){
  33. Goroi_n_Create_Button(url);
  34. const form = document.querySelector('[action="get-url.php"]')
  35. const redirect = form.querySelector('#url').getAttribute('value');
  36. if (redirect !== null) {
  37. form.submit();
  38. clearInterval(time);
  39. }
  40. }
  41. },10);
  42. })();