Auto Remote Upload + ToS

Automatically selects remote URL upload and ticks the TOS box on file hosting sites often used on Mobilism

当前为 2024-03-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Remote Upload + ToS
  3. // @namespace https://github.com/AbdurazaaqMohammed
  4. // @version 1.1.1
  5. // @description Automatically selects remote URL upload and ticks the TOS box on file hosting sites often used on Mobilism
  6. // @author Abdurazaaq Mohammed
  7. // @author Abdurazaaq Mohammed
  8. // @match https://userupload.net/?op=upload_form
  9. // @match https://userupload.in/?op=upload_form
  10. // @match https://uploadrar.com/
  11. // @match https://devuploads.com/upload
  12. // @match https://dropgalaxy.vip/
  13. // @match https://dropgalaxy.co/
  14. // @match https://dropgalaxy.com/
  15. // @match https://dgdrive.xyz/
  16. // @grant none
  17. // @homepage https://github.com/AbdurazaaqMohammed/userscripts
  18. // @license The Unlicense
  19. // @supportURL https://github.com/AbdurazaaqMohammed/userscripts/issues
  20. // ==/UserScript==
  21.  
  22. (function() {
  23. 'use strict';
  24.  
  25. var uploadButton = document.querySelector('.uploadbtn.btn-primary.btn');
  26.  
  27.  
  28. const url = window.location.href;
  29. const inputField = document.querySelector("textarea");
  30. setTimeout(function() { //Click on the box
  31. if(inputField && document.activeElement !== inputField){
  32. inputField.focus();
  33. }
  34. }, 500);
  35.  
  36. if (url.includes('dropgalaxy') || url.includes('dgdrive')) {
  37. document.querySelector("#tab-remote_upload > span").click();
  38. }
  39. else if (url.includes('userupload')) {
  40. document.querySelector("#select_url").click();
  41. document.querySelector(".custom-control-label").click(); //devuploads and uploadrar already enable TOS by default. I can't remember about DG
  42. }
  43. else {
  44. const form = document.querySelector("#select_url");
  45. uploadButton = document.querySelector('#uploadurl > div.pull-right > button');
  46. const intervalId = setInterval(function() { //uploadrar refuses to work if you don't do this
  47. if(form) {
  48. form.click();
  49. clearInterval(intervalId);
  50. }
  51. }, 200);
  52. }
  53.  
  54. document.addEventListener('keydown', function(e) {
  55. const key = e.key;
  56. if (key == "Enter") uploadButton.click();
  57. // You can add more keys or change them as you want. The documentation for key values can be found here: https://developer.mozilla.org/en-US/docs/web/api/ui_events/keyboard_event_key_values
  58. });
  59.  
  60. })();