Category whitelist #10
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,5 @@
|
|||||||
config.json
|
|
||||||
*.log
|
*.log
|
||||||
|
*.json
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
11
README.md
11
README.md
@ -44,6 +44,15 @@ Config.json
|
|||||||
"po_token": ""
|
"po_token": ""
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You will need a tracker-whitelist.json in the root directory
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"example": "general"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
| Key | Value |
|
| Key | Value |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| host | string, ip or hostname of qbittorrent server |
|
| host | string, ip or hostname of qbittorrent server |
|
||||||
@ -51,6 +60,8 @@ Config.json
|
|||||||
| username | admin account for qbittorrent |
|
| username | admin account for qbittorrent |
|
||||||
| password | password for admin account |
|
| password | password for admin account |
|
||||||
| loglevel | is what log messages are written to the log file. INFO or DEBUG are valid entries(case sensitive) |
|
| 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 |
|
| 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 |
|
| age | number, seconds for how long we keep torrents from IPTORRENTS |
|
||||||
| use_pushover | true or false to enable or disable pushover notification summary |
|
| use_pushover | true or false to enable or disable pushover notification summary |
|
||||||
|
3
category-whitelist.json.example
Normal file
3
category-whitelist.json.example
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"example": "general"
|
||||||
|
}
|
6
qlist.py
6
qlist.py
@ -10,7 +10,8 @@ def buildtorlist(self):
|
|||||||
torrent = self.torrentlist.pop()
|
torrent = self.torrentlist.pop()
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
self.tl.debug(f'["{torrent["name"][0:20]}..."] {torrent["infohash_v1"]}')
|
self.tl.debug(f'["{torrent["name"][0:20]}..."] {torrent["infohash_v1"]}')
|
||||||
if torrent['category'] == 'tech':
|
if torrent['tags'] in self.cat_whitelist.values():
|
||||||
|
self.tl.info(f'Ignored torrent:["{torrent["name"][0:20]}..."]')
|
||||||
continue
|
continue
|
||||||
if torrent['tracker'] == '':
|
if torrent['tracker'] == '':
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
@ -57,3 +58,6 @@ def torrentcount(self):
|
|||||||
def tordeletetags(self):
|
def tordeletetags(self):
|
||||||
tag_list = ['ipt','public','iptorrents']
|
tag_list = ['ipt','public','iptorrents']
|
||||||
self.qbt_client.torrents_delete_tags(tag_list)
|
self.qbt_client.torrents_delete_tags(tag_list)
|
||||||
|
|
||||||
|
def torlisttags(self):
|
||||||
|
pass
|
@ -3,7 +3,7 @@ def torprocessor(self):
|
|||||||
If torrent meets criteria for deletion, its infohash_v1 will be appended to self.torrent_hash_delete_list
|
If torrent meets criteria for deletion, its infohash_v1 will be appended to self.torrent_hash_delete_list
|
||||||
"""
|
"""
|
||||||
for canidate in self.tracker_nonprotected_list:
|
for canidate in self.tracker_nonprotected_list:
|
||||||
if 'ipt' in canidate['tags']:
|
if canidate['tags'] in self.cat_whitelist.values():
|
||||||
if self.use_log:
|
if self.use_log:
|
||||||
self.tl.warning(f'["{canidate["name"][0:20]}..."] was in non-protected list.')
|
self.tl.warning(f'["{canidate["name"][0:20]}..."] was in non-protected list.')
|
||||||
continue
|
continue
|
||||||
|
Loading…
x
Reference in New Issue
Block a user