JDownloader Automat

Send fireload.com (or any active webpage) URL to JDownloader using Click'n'Load 2 functionality.

目前为 2023-05-07 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name JDownloader Automat
  3. // @namespace https://toplak.info
  4. // @author Bernard Toplak
  5. // @version 1.0.1
  6. // @licence GPL3
  7. // @description Send fireload.com (or any active webpage) URL to JDownloader using Click'n'Load 2 functionality.
  8. // @match https://*.fireload.com/*
  9. // @grant GM.xmlHttpRequest
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var url = window.location.href;
  16. var jdownloaderUrl = 'http://127.0.0.1:9666/flash/add?urls='+url;
  17.  
  18. GM.xmlHttpRequest({
  19. method: 'POST',
  20. url: jdownloaderUrl,
  21. /*
  22. required to skip the pop-up requesting confirmation each time a new URL is added
  23. Additional change is necessary in JD settings:
  24. go to Settings -> Advanced Settings (icon left) -> enter "remoteapi" and add "localhost" to the JSON
  25. */
  26. headers : {
  27. Referer: "http://localhost/"
  28. },
  29. onload: function(response) {
  30. console.log('URL sent to JDownloader: '+url);
  31. },
  32. onerror: function(error) {
  33. console.error('Error sending URL to JDownloader:', error);
  34. }
  35. });
  36.  
  37. })();