HDC Selector

Automatic add eligible torrents to rsscart. You must have a HDChina account first.

  1. // ==UserScript==
  2. // @name HDC Selector
  3. // @name HDC检查器
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.1
  6. // @description Automatic add eligible torrents to rsscart. You must have a HDChina account first.
  7. // @description Visit https://hdchina.org/torrents.php and leave the page alone, it will be refreshed every 5 minutes to check torrents.
  8. // @description You can change the condicions max_size, max_seed and refresh below.
  9. // @description 自动添加符合条件的种子到下载框。你必须先有一个HDChina的账号。
  10. // @description 打开https://hdchina.org/torrents.php页面,窗口会每5分钟自动刷新检查是否有符合条件的种子。
  11. // @description 你可以修改下方的添加条件max_size(最大尺寸)、max_seed(当前做种数)和refresh(刷新间隔)。
  12. // @author Garydz
  13. // @match https://hdchina.org/torrents.php
  14. // @grant none
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19. var max_size = 10; // only automatic add torrents < 10 GB
  20. var max_seed = 4; // and current seeders < 4
  21. var refresh = 5; // every 5 minutes
  22. function find_pnode(o){
  23. var pn = o;
  24. do{
  25. pn = pn.parentNode;
  26. }while(pn.className != 't_name');
  27. return pn;
  28. }
  29. function find_sibling(o, cls_name){
  30. var sn = o;
  31. do{
  32. sn = sn.nextSibling;
  33. }while(sn.className != cls_name);
  34. return sn;
  35. }
  36. function check_torrents(arr){
  37. var l = arr.length;
  38. for(var i=0;i<l;i++){
  39. var t = find_pnode(arr[i]);
  40. var bm = t.getElementsByClassName('delbookmark_rss');
  41. if(bm.length > 0){
  42. var t_size = find_sibling(t, 't_size').innerText;
  43. if((t_size.indexOf('MB')>0) || (t_size.indexOf('GB') && (parseInt(t_size) < max_size))){
  44. var t_torrents = parseInt(find_sibling(t, 't_torrents').innerText);
  45. if(t_torrents < max_seed){
  46. bm[0].parentNode.click();
  47. }
  48. }
  49. }
  50. }
  51. }
  52. var freebies = document.getElementsByClassName('pro_free');
  53. check_torrents(freebies);
  54. setTimeout("window.location.reload()", refresh*60000);
  55. })();

QingJ © 2025

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