RapidGator Premium Downloader

Downloads from RapidGator account

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/4179/13236/RapidGator%20Premium%20Downloader.js

  1. // ==UserScript==
  2. // @name RapidGator Premium Downloader
  3. // @version 0.3
  4. // @description Downloads from RapidGator account
  5. // @namespace https://github.com/ohec/RapidGator-Premium-Downloader
  6. // @downloadURL https://github.com/ohec/RapidGator-Premium-Downloader/raw/master/RapidGator_Premium_Downloader.user.js
  7. // @include http://rapidgator.net/file/*
  8. // @include http://www.rapidgator.net/file/*
  9. // ==/UserScript==
  10. (function () {
  11. var gm_plugin = function () {
  12. var options = {
  13. debug: false,
  14. openLink: true, // Open by clicking the link
  15. openUrl: false // Open by setting the window href
  16. };
  17. return {
  18. /**
  19. * Do the click
  20. */
  21. init: function () {
  22. if (document.title == 'File not found') {
  23. this.log('File not found - Closing');
  24. unsafeWindow.close();
  25. } else {
  26. var downloadLinks;
  27. downloadLinks = document.evaluate('//div[@class="btm"]/p/a', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  28. for (var i = 0; i < downloadLinks.snapshotLength; i++) {
  29. var link = downloadLinks.snapshotItem(i);
  30. var url = link.href;
  31. if(options.openUrl == 1) {
  32. unsafeWindow.location.href = url;
  33. } else if(options.openLink == 1) {
  34. link.click();
  35. } else {
  36. this.log('Opening ' + url);
  37. }
  38. //unsafeWindow.location.href = link.href;
  39. //link.click();
  40. }
  41. }
  42. },
  43. /**
  44. * Log message
  45. *
  46. * @param message
  47. */
  48. log: function (message) {
  49. if (options.debug > 0) {
  50. console.log(message);
  51. }
  52. }
  53. };
  54. }
  55. var gm = new gm_plugin();
  56. gm.init();
  57. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址