tgregerson

qBittorrent sample auto_torrent_customizer_rules.json

Feb 25th, 2024 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 6.51 KB | Source Code | 0 0
  1. {
  2.     "Comment1": "Sample auto_torrent_customizer_rules.json",
  3.     "Comment2": "Designed for testing with https://webtorrent.io/free-torrents",
  4.     "Comment3": "These comment fields are for human readers. qBt ignores them.",
  5.  
  6.     "Rules": [
  7.         {
  8.             "Comment1": "This should match any torrent. However since rules are ",
  9.             "Comment2": "applied in order, it may be overwritten by any other ",
  10.             "Comment3": "SetCategory rule afterward.",
  11.             "Condition": {
  12.                 "RegexPattern": ".*",
  13.                 "Type": "AnyFilePathRegex"
  14.             },
  15.             "Modifier": {
  16.                 "Category": "DefaultCategory",
  17.                 "Type": "SetCategory"
  18.             }
  19.         },
  20.         {
  21.             "Comment1": "This should also match any torrent. However AddTag ",
  22.             "Comment2": "rules do not override each other, their order is ",
  23.             "Comment3": "typically not important.",
  24.             "Condition": {
  25.                 "RegexPattern": ".*",
  26.                 "Type": "AnyTrackerUrlRegex"
  27.             },
  28.             "Modifier": {
  29.                 "Tag": "HasAnyTracker",
  30.                 "Type": "AddTag"
  31.             }
  32.         },
  33.         {
  34.             "Condition": {
  35.                 "RegexPattern": ".*(jpg|mp3|mp4|webm)",
  36.                 "Type": "AnyFilePathRegex"
  37.             },
  38.             "Modifier": {
  39.                 "Category": "Media",
  40.                 "Type": "SetCategory"
  41.             }
  42.         },
  43.         {
  44.             "Comment": "Similar to above, but with a compound condition.",
  45.             "Condition": {
  46.                 "Conditions": [
  47.                     {
  48.                         "RegexPattern": ".*mp3",
  49.                         "Type": "AnyFilePathRegex"
  50.                     },
  51.                     {
  52.                         "RegexPattern": ".*mp4",
  53.                         "Type": "AnyFilePathRegex"
  54.                     },
  55.                     {
  56.                         "RegexPattern": ".*jpg",
  57.                         "Type": "AnyFilePathRegex"
  58.                     },
  59.                     {
  60.                         "RegexPattern": ".*webm",
  61.                         "Type": "AnyFilePathRegex"
  62.                     }
  63.                 ],
  64.                 "Type": "AnyOf"
  65.             },
  66.             "Modifier": {
  67.                 "Tag": "Media",
  68.                 "Type": "AddTag"
  69.             }
  70.         },
  71.         {
  72.             "Comment": "Escape special regex characters with a double-slash.",
  73.             "Condition": {
  74.                 "RegexPattern": ".*\\.srt",
  75.                 "Type": "AnyFilePathRegex"
  76.             },
  77.             "Modifier": {
  78.                 "Tag": "Subtitles",
  79.                 "Type": "AddTag"
  80.             }
  81.         },
  82.         {
  83.             "Comment1": "Advanced regex use: Contains English SRT and no ",
  84.             "Comment2": "non-English SRT. QT supports PCRE syntax, allowing ",
  85.             "Comment3": "use of negative look-around patterns.",
  86.             "Condition": {
  87.                 "Conditions": [
  88.                     {
  89.                         "RegexPattern": ".*\\.en\\.srt",
  90.                         "Type": "AnyFilePathRegex"
  91.                     },
  92.                     {
  93.                         "Type": "Not",
  94.                         "Condition": {
  95.                             "RegexPattern": ".*(?<!\\.en)\\.srt",
  96.                             "Type": "AnyFilePathRegex"
  97.                         }
  98.                     }
  99.                 ],
  100.                 "Type": "AllOf"
  101.             },
  102.             "Modifier": {
  103.                 "Tag": "English Subtitles Only",
  104.                 "Type": "AddTag"
  105.             }
  106.         },
  107.         {
  108.             "Comment": "Using AND-style conditions and compound modifier.",
  109.             "Condition": {
  110.                 "Conditions": [
  111.                     {
  112.                         "RegexPattern": ".*(mp4|webm)",
  113.                         "Type": "AnyFilePathRegex"
  114.                     },
  115.                     {
  116.                         "RegexPattern": ".*poster.*(jpg|png)",
  117.                         "Type": "AnyFilePathRegex"
  118.                     }
  119.                 ],
  120.                 "Type": "AllOf"
  121.             },
  122.             "Modifier": {
  123.                 "Modifiers": [
  124.                     {
  125.                         "Tag": "VideoWithPoster",
  126.                         "Type": "AddTag"
  127.                     },
  128.                     {
  129.                         "Tag": "MixedMedia",
  130.                         "Type": "AddTag"
  131.                     }
  132.                  ],
  133.                 "Type": "Compound"
  134.             }
  135.         },
  136.         {
  137.             "Comment": "Using a relative save path",
  138.             "Condition": {
  139.                 "RegexPattern": ".*mp4",
  140.                 "Type": "AnyFilePathRegex"
  141.             },
  142.             "Modifier": {
  143.                 "Path": "Video",
  144.                 "Type": "SetSavePath"
  145.             }
  146.         },
  147.         {
  148.             "Comment1": "Using an absolute save path. Update 'Path' to a valid ",
  149.             "Comment2": "path for your system to avoid an error.",
  150.             "Condition": {
  151.                 "RegexPattern": ".*webm",
  152.                 "Type": "AnyFilePathRegex"
  153.             },
  154.             "Modifier": {
  155.                 "Path": "/home/user/Downloads/Video",
  156.                 "Type": "SetSavePath"
  157.             }
  158.         },
  159.         {
  160.             "Comment": "Error: Invalid save path",
  161.             "Condition": {
  162.                 "RegexPattern": ".*mp3",
  163.                 "Type": "AnyFilePathRegex"
  164.             },
  165.             "Modifier": {
  166.                 "Path": "",
  167.                 "Type": "SetSavePath"
  168.             }
  169.         },
  170.         {
  171.             "Condition": {
  172.                 "RegexPattern": ".*",
  173.                 "Type": "AnyFilePathRegex"
  174.             },
  175.             "Modifier": {
  176.                 "Comment": "Error: Missing required 'Category' field",
  177.                 "Type": "SetCategory"
  178.             }
  179.         },
  180.         {
  181.             "Condition": {
  182.                 "RegexPattern": ".*",
  183.                 "Type": "AnyFilePathRegex"
  184.             },
  185.             "Modifier": {
  186.                 "Comment": "Error: Unsupported Modifier Type",
  187.                 "Type": "EnableTurboMode"
  188.             }
  189.         },
  190.         {
  191.             "Condition": {
  192.                 "Comment": "Error: Unsupported Condition Type",
  193.                 "Type": "IsThisWorthMyTime"
  194.             },
  195.             "Modifier": {
  196.                 "Category": "Worthy",
  197.                 "Type": "SetCategory"
  198.             }
  199.         }
  200.     ]
  201. }
Add Comment
Please, Sign In to add comment