diff --git a/README.md b/README.md index d3b77a7..f176f20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # qbit-maid -Warning: This application removes torrents that aren't downloading and that aren't from iptorrents. Age in the config.json only controls the age for torrents from iptorrents. +## Warning: This application removes torrents that are over the minimum age and that are not part of the ignored categories, domains or tags. Please use the delete_torrents feature set to false when first testing its functionality. The objective is to remove torrents based on the following criteria: - tracker domain name @@ -24,9 +24,32 @@ graph TD; | qlist.py | Builds out torrent lists | | qlogging.py | Logging and push notification communication | | qprocess.py | Submits qualifying torrents for deletion | +| test_qbitmaid.py | Unit tests | +| ignored_categories.json | whitelist for categorys to ignore | +| ignored_tags.json | whitelist for torrent tags to ignore | +| ignored_trackers.json | whitelist of fqdn names to ignore | You will need a config.json in the root directory. +| Key | Value | +| --- | --- | +| host | string, ip or hostname of qbittorrent server | +| port | number, port of admin gui(used for api aswell) | +| username | admin account for qbittorrent | +| password | password for admin account | +| loglevel | is what log messages are written to the log file. INFO or DEBUG are valid entries(case sensitive) | +| protected_tag | used to mark torrents to handle with care | +| non_protected_tag | we don't care about these torrents | +| logpath | will write a log in root directory if left as is other wise specify other path using forward slashes | +| age | number, seconds for how long we keep torrents from IPTORRENTS | +| minimum_age | age in seconds torrents should reached before they are removed | +| use_pushover | true or false to enable or disable pushover notification summary | +| use_log | true or false to enable or disable writing to alog file | +| po_key | pushover key | +| po_token | pushover api token | +| delete_torrents | true or false to enable or disable deletion. Useful for dry-runs | +| enable_dragnet | true or false to enable dragnet functionality. Useful for debugging | + It should look something like this: Config.json ``` @@ -51,7 +74,7 @@ Config.json } ``` -You will need a category-whitelist.json in the root directory. This will ignore any of the categories found in the values of the entries. +You will need a ignored_categories.json in the root directory. This will ignore any of the categories found in the values of the entries. ``` { "example": "general", @@ -59,22 +82,20 @@ You will need a category-whitelist.json in the root directory. This will ignore } ``` +You will need a ignored_domains.json in the root directory. This will ignore any torrents from these trackers. +``` +{ +"iptorrents-empirehost": "ssl.empirehost.me", +"iptorrents-stackoverflow": "localhost.stackoverflow.tech", +"iptorrents-bgp": "routing.bgp.technology" +} +``` -| Key | Value | -| --- | --- | -| host | string, ip or hostname of qbittorrent server | -| port | number, port of admin gui(used for api aswell) | -| username | admin account for qbittorrent | -| password | password for admin account | -| loglevel | is what log messages are written to the log file. INFO or DEBUG are valid entries(case sensitive) | -| protected_tag | used to mark torrents to handle with care | -| non_protected_tag | we don't care about these torrents | -| logpath | will write a log in root directory if left as is other wise specify other path using forward slashes | -| age | number, seconds for how long we keep torrents from IPTORRENTS | -| minimum_age | age in seconds torrents should reached before they are removed | -| use_pushover | true or false to enable or disable pushover notification summary | -| use_log | true or false to enable or disable writing to alog file | -| po_key | pushover key | -| po_token | pushover api token | -| delete_torrents | true or false to enable or disable deletion. Useful for dry-runs | -| enable_dragnet | true or false to enable dragnet functionality. Useful for debugging | \ No newline at end of file +You will need a ignored_tags.json in the root directory. This will ignore any torrents with these tags. +``` +{ +"first":"first", +"second":"second", +"third":"third" +} +``` \ No newline at end of file diff --git a/category-whitelist.json.example b/ignored_categories.json.example similarity index 100% rename from category-whitelist.json.example rename to ignored_categories.json.example diff --git a/tracker-whitelist.json.example b/ignored_domains.json.example similarity index 100% rename from tracker-whitelist.json.example rename to ignored_domains.json.example diff --git a/ignored_tags copy.json.example b/ignored_tags.json.example similarity index 100% rename from ignored_tags copy.json.example rename to ignored_tags.json.example diff --git a/qbit-maid.py b/qbit-maid.py index dca066f..32e2a89 100644 --- a/qbit-maid.py +++ b/qbit-maid.py @@ -18,7 +18,7 @@ class Qbt: self.st = datetime.datetime.now() c = open('./config.json') self.config = load(c) - w = open('./category-whitelist.json') + w = open('./ignored_categories.json') self.cat_whitelist = load(w) tg = open('./ignored_tags.json') self.ignored_tags = load(tg) @@ -52,7 +52,7 @@ class Qbt: tornotify(self) self.t = time # Pulling domain names to treat carefully - f = open('./tracker-whitelist.json') + f = open('./ignored_domains.json') self.tracker_whitelist = load(f) self.tracker_list = [] self.up_tor_counter = 0