Closed fffe closed 6 days ago
... the filtering appears to work inconsistently.
rtcontrol is_complete=yes is_open=yes is_ignored=no tracker=\*trackerthatexists.net\* -q
displays a list of all torrents from that tracker, as expected.
rtcontrol is_complete=yes is_open=yes is_ignored=no tracker=\*nothingusesme.net\*,\*trackerthatexists.net\* -q
shows nothing, which is unexpected.
In my postprocessing scripts (previously working on rt-ps) this used to be treated as an OR; I used it for filtering torrents that matched any of a handful of trackers.
It looks like either it's being treated as an AND here, or it's just silently failing. I'm not sure which.
Okay, I had been missing the rtorrent config, but filtering on trackers is still breaking as described above.
Is this a bug or have I skipped a step somewhere?
By default --json
tries to output all fields, which includes a field that expects the custom command d.session_file
. It's a simple method, and definition is available here, but I'll probably rewrite it to not depend on that. In general a full --json
is going to be pretty heavy, I'd recommend combining it with -o
to limit the fields being fetched.
rtcontrol is_complete=yes is_open=yes is_ignored=no tracker=\*nothingusesme.net\*,\*trackerthatexists.net\* -q
shows nothing, which is unexpected.
Here the ,
is being treated as part of the search string, it doesn't have any special OR significance. Try: rtcontrol is_complete=yes is_open=yes is_ignored=no [ tracker=\*nothingusesme.net\* OR tracker=\*trackerthatexists.net\* ]
Alternatively, you can accomplish the same goal with regexes: rtcontrol is_complete=yes is_open=yes is_ignored=no tracker=/nothingusesme.net\|trackerthatexists.net/
Yeah, I screwed up. I didn't realize there were additional steps beyond just installing the python bits.
Try: rtcontrol is_complete=yes is_open=yes is_ignored=no [ tracker=*nothingusesme.net* OR tracker=*trackerthatexists.net* ]
This throws an error. I tried a couple of different things in case I was missing some escaping, but I always get the same error:
username@host:~/bin$ rtcontrol is_complete=yes is_open=yes is_ignored=no [ tracker=\*nothingusesme.net\* OR tracker=\*trackerthatexists.net\* ] fno=1
username@host:~/bin$ rtcontrol is_complete=yes is_open=yes is_ignored=no [ tracker=\*nothingusesme.net\* OR tracker=\*trackerthatexists.net\* ] fno=1
Traceback (most recent call last):
File "/home/username/test_venv/bin/rtcontrol", line 8, in <module>
sys.exit(run())
^^^^^
File "/home/username/test_venv/lib/python3.12/site-packages/pyrosimple/scripts/rtcontrol.py", line 1055, in run
RtorrentControl().run()
File "/home/username/test_venv/lib/python3.12/site-packages/pyrosimple/scripts/base.py", line 184, in run
self.mainloop()
File "/home/username/test_venv/lib/python3.12/site-packages/pyrosimple/scripts/rtcontrol.py", line 787, in mainloop
self.log.debug("Matcher is: %s", matcher.to_match_string())
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/username/test_venv/lib/python3.12/site-packages/pyrosimple/util/matching.py", line 193, in to_match_string
child_strings = [c.to_match_string() for c in self.children]
^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'to_match_string'
Alternatively, you can accomplish the same goal with regexes: rtcontrol is_complete=yes is_open=yes is_ignored=no tracker=/nothingusesme.net|trackerthatexists.net/
This worked, thanks.
Is this a functional change from pyrocore? That comma syntax works/worked on my old rt-ps setup.
This throws an error. I tried a couple of different things in case I was missing some escaping, but I always get the same error:
This is happening because of the fno=1
at the end. I'll have to dig into exactly why that is, it's definitely a bug, but moving that to the front of the filters seems to make it work.
Is this a functional change from pyrocore? That comma syntax works/worked on my old rt-ps setup.
Indeed it is, I've never really used the feature so I missed documenting it's removal, that's been add to the migration page now: https://github.com/kannibalox/pyrosimple/commit/7468517c0c7b396a41d8c0a4d74518845b874190
I've documented the change in behavior and fixed the associated bug, closing this out.
I'm unable to fetch or filter on the trackers field with rtcontrol, using the current version of pyrosimple against the current master branches of (vanilla) rtorrent/libtorrent.
Without the filter, this displays the torrent as expected. I'm not sure why this is failing, as those methods appear to exist:
I'm getting a similar error trying to format output as JSON:
This time the method doesn't exist:
Is this a bug or have I skipped a step somewhere?