Closed BinsonBuzz closed 4 years ago
Sorry, I had another question - how does the private tag work in the example posted in the readme? Does it assume any trackers not listed i.e not tracker.coppersurfer.tk are private? So, if I want to treat two trackers as public and the others as private I have to do the following?
{
"category": "test",
"tracker": "public.tracker.1.com",
"public": {
"min_seed_ratio": 2,
"max_seed_ratio": 10000,
"min_seed_time": 1,
"max_seed_time": 960,
"required_seeders": 1
},
"tracker": "public.tracker.2.com",
"public": {
"min_seed_ratio": 2,
"max_seed_ratio": 10000,
"min_seed_time": 1,
"max_seed_time": 960,
"required_seeders": 1
},
# Anything not matching the two items above will go into private
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 10000,
"min_seed_time": 480,
"max_seed_time": 960,
"required_seeders": 1
},
"delete_files": true,
}
Is it possible to do it the other way around i.e. if not listed as a private tracker, then treat as public? This is safer IMO and a better way as I have fewer private trackers so easier to identify and list, rather the tonne of public tracker urls that might pop up i..e
{
"category": "test",
"tracker": "private.tracker.1.com"
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 10000,
"min_seed_time": 1,
"max_seed_time": 960,
"required_seeders": 1
},
"tracker": "private.tracker.2.com"
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 10000,
"min_seed_time": 1,
"max_seed_time": 960,
"required_seeders": 1
},
# Anything not matching the two items above will go into public
"public": {
"min_seed_ratio": 2,
"max_seed_ratio": 10000,
"min_seed_time": 480,
"max_seed_time": 960,
"required_seeders": 1
},
"delete_files": true,
}
Thanks for the nice words.
Did you keep the resources folder in the same folder as qbit_ratio_manager.py? It contains files that the qbit_ratio_manager.py needs to run
The script already identifies private and public torrents by itself, since qBittorrent already has this information.
The "tracker" option is only useful to you if you want different rules for each tracker in a category and will apply to both private and public torrents for that tracker. Also you can only have one "tracker" option for each .qman
Thanks for getting back so quickly and the answer re private/public torrents. I didn't realise qB did this.
Re the initial error, yep it was me - I didn't copy the whole zip - just the script.
I'm getting a new error now though - any ideas? Thanks
root@Highlander:/mnt/cache/appdata/other/qbittorrent/scripts/qBittorrent-Ratio-Manager-master# python3 qbit_ratio_manager.py --url http://192.168.50.60:8080/api/v2 --username xxxxx --password xxxxxxxx --verbose
Traceback (most recent call last):
File "qbit_ratio_manager.py", line 120, in <module>
categoryProfile.process_category()
File "/mnt/cache/appdata/other/qbittorrent/scripts/qBittorrent-Ratio-Manager-master/resources/CategoryProfile.py", line 52, in process_category
torrents = QBitController.get_torrents_by_category(self.category)
File "/mnt/cache/appdata/other/qbittorrent/scripts/qBittorrent-Ratio-Manager-master/resources/QBitController.py", line 57, in get_torrents_by_category
return QBitController.get("torrents/info?category=" + category).json()
File "/usr/lib64/python3.8/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Can you post your entire .qman file(s)?
using this for a test - named test.qman
{
"category": "imported",
"public": {
"min_seed_ratio": 1,
"max_seed_ratio": 2,
"min_seed_time": 1,
"max_seed_time": 2,
"required_seeders": 0
},
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 20,
"min_seed_time": 360,
"max_seed_time": 361,
"required_seeders": 1
},
"delete_files": true
}
Looking more closely at the error, it's actually the result from qBittorrent that's not being parsed correctly. Are you running a qBittorrent version over 4.20, i haven't tested with any previous versions.
I'm running 4.2.1 in docker (https://hub.docker.com/r/binhex/arch-qbittorrentvpn/)
Can you try putting a slash at the end of your url, like so --url http://192.168.50.60:8080/api/v2/
Can you try putting a slash at the end of your url, like so --url http://192.168.50.60:8080/api/v2/
That worked! I knew it'd be me - thanks.
One last question, if I want to have per tracker settings for 2 private trackers, generic settings for other private and public trackers will this work? I'm just cautious about messing up private trackers for obvious reasons.
I've put my per tracker rules first as I'm assuming it works from top-2-bottom.
{
"category": "imported",
"public": {
"min_seed_ratio": 1,
"max_seed_ratio": 2,
"min_seed_time": 1,
"max_seed_time": 2,
"required_seeders": 0
},
"tracker": "private_tracker1.com",
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 20,
"min_seed_time": 360,
"max_seed_time": 360,
"required_seeders": 1
},
"tracker": "private_tracker2.com",
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 5,
"min_seed_time": 180,
"max_seed_time": 180,
"required_seeders": 1
},
# other private other than private_tracker1.com and private_tracker2.com get picked up by next rule
"private": {
"min_seed_ratio": 2,
"max_seed_ratio": 20,
"min_seed_time": 360,
"max_seed_time": 361,
"required_seeders": 1
},
"delete_files": true
}
Great!
First you can only have one "tracker" entry for each .qman file and it will apply to both private and public torrents from that tracker.
Second, if you want tracker specific options you SHOULD NOT have any generic options for the same category, as they will apply to every torrent in that category, even the ones you also have tracker specific options for.
Lastly, the tracker url you should be using in the "tracker" option is not for example "iptorrents.com", but rather one of the actual trackers that they use in their torrents, fx "routing.bgp.technology", you can find these in qBittorrent.
got it:
Perfect - works just how I want. Thanks again
Exactly :) Feel free to ask again if more confusions arise. I admit it's not perfectly simple, but i'm yet to find better ways to structure the configuration options.
Thanks for pulling this together. It's exactly what I need if I can get it running. I get this error when I try to run:
ModuleNotFoundError: No module named 'resources.CategoryProfile'
Am I (probably), doing something stupid? Thanks