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. // @match *://userupload.*/?op=upload_form
  8. // @match *://uploadrar.com/
  9. // @match *://devuploads.com/upload
  10. // @match *://dropgalaxy.*/
  11. // @match *://dgdrive.xyz/
  12. // @match https://apkadmin.com/
  13. // @grant none
  14. // @homepage https://github.com/AbdurazaaqMohammed/userscripts
  15. // @license The Unlicense
  16. // @supportURL https://github.com/AbdurazaaqMohammed/userscripts/issues
  17. // ==/UserScript==
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. var uploadButton = document.querySelector('.uploadbtn.btn-primary.btn');
  23.  
  24.  
  25. const url = window.location.href;
  26. const inputField = document.querySelector("textarea");
  27. setTimeout(function() { //Click on the box
  28. if(inputField && document.activeElement !== inputField){
  29. inputField.focus();
  30. }
  31. }, 500);
  32.  
  33. if (url.includes('dropgalaxy') || url.includes('dgdrive')) {
  34. document.querySelector("#tab-remote_upload > span").click();
  35. }
  36. else if (url.includes('userupload')) {
  37. document.querySelector("#select_url").click();
  38. document.querySelector(".custom-control-label").click(); //devuploads and uploadrar already enable TOS by default. I can't remember about DG
  39. }
  40. else {
  41. const form = document.querySelector("#select_url");
  42. uploadButton = document.querySelector('#uploadurl > div.pull-right > button');
  43. const intervalId = setInterval(function() { //uploadrar refuses to work if you don't do this
  44. if(form) {
  45. form.click();
  46. clearInterval(intervalId);
  47. }
  48. }, 200);
  49. }
  50.  
  51. document.addEventListener('keydown', function(e) {
  52. const key = e.key;
  53. if (key == "Enter") uploadButton.click();
  54. // 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
  55. });
  56.  
  57. })();