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

  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')) {
  39. document.querySelector("#select_url").click();
  40. document.querySelector(".custom-control-label").click();
  41. }
  42. else if(url.includes('devuploads')) {
  43. document.querySelector("#select_url").click();
  44. }
  45. else {
  46. const form = document.querySelector("#select_url");
  47. uploadButton = document.querySelector('#uploadurl > div.pull-right > button');
  48. const intervalId = setInterval(function() { //uploadrar refuses to work if you don't do this
  49. if(form) {
  50. form.click();
  51. clearInterval(intervalId);
  52. }
  53. }, 200);
  54. }
  55.  
  56. document.addEventListener('keydown', function(e) {
  57. const key = e.key;
  58. if (key == "Shift") uploadButton.click();
  59. // 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
  60. });
  61.  
  62. })();