Auto Remote Upload + ToS

Automatically selects remote URL upload, ticks the TOS box, focuses the input area and allows uploading by pressing Enter on file hosting sites often used on Mobilism

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

  1. // ==UserScript==
  2. // @name Auto Remote Upload + ToS
  3. // @namespace https://github.com/AbdurazaaqMohammed
  4. // @version 1.1.2
  5. // @description Automatically selects remote URL upload, ticks the TOS box, focuses the input area and allows uploading by pressing Enter 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. const url = window.location.href;
  28. const inputField = document.querySelector("textarea");
  29. setTimeout(function() { // Click on the input area
  30. if(inputField && document.activeElement !== inputField){
  31. inputField.focus();
  32. }
  33. }, 500);
  34.  
  35. if (url.includes('dropgalaxy') || url.includes('dgdrive')) {
  36. document.querySelector("#tab-remote_upload > span").click();
  37. }
  38. else if (url.includes('userupload') || url.includes('devuploads')) {
  39. document.querySelector("#select_url").click();
  40. document.querySelector(".custom-control-label").disabled = false;
  41. }
  42. else {
  43. const form = document.querySelector("#select_url");
  44. uploadButton = document.querySelector('#uploadurl > div.pull-right > button');
  45. const intervalId = setInterval(function() { //uploadrar refuses to work if you don't do this
  46. if(form) {
  47. form.click();
  48. clearInterval(intervalId);
  49. }
  50. }, 200);
  51. }
  52.  
  53. document.addEventListener('keydown', function(e) {
  54. const key = e.key;
  55. if (key == "Shift") uploadButton.click();
  56. // 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
  57. });
  58.  
  59. })();