Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: filter by category #140

Open
gongfarmer opened this issue Oct 27, 2020 · 4 comments
Open

Request: filter by category #140

gongfarmer opened this issue Oct 27, 2020 · 4 comments

Comments

@gongfarmer
Copy link

I want to be able to list recent torrents to see if my kid's favourite TV show is uploaded without seeing porn titles like "petite sluts anal submission."

I tried to limit it to just the TV category like this:

pirate-get -R -c 205
pirate-get -c "Video/TV shows" -R

However this has no effect, the recent torrents list shows all categories.

I would prefer a category blacklist rather than a whitelist, since it is interesting to see what is going on in ebook uploads and other low-traffic categories.
Ideally this would be a config file setting, which applied to the search command as well.

@rnhmjoj
Copy link
Collaborator

rnhmjoj commented Oct 27, 2020

At the time I rewrote pirate-get to use the new API, the query to get recent torrents didn't take any parameter: it just lists all recent torrent from any category.

This wasn't even possible from the website, which uses the very same API.
Unless they have updated the API to make more complex queries, I don't think I can do anything. Can you do it from the site? I haven't checked it in a while.

@gongfarmer
Copy link
Author

No, as far as I know this is not a feature of the API.
Does the API return list items that include a category id?

What about this:

  1. "recent" query returns items
  2. items with a blacklisted category id are discarded
  3. remaining items are then printed

@rnhmjoj
Copy link
Collaborator

rnhmjoj commented Oct 27, 2020

Sure, in fact you can already do what you're asking using the JSON output.
If you have jq try this:

pirate-get -R -j | jq 'map(select(.category == 205).name)'

The problem with this approach is that the recent query only returns 100 results; so, filtering for a rare category is likely going to discard all results.

@gongfarmer
Copy link
Author

Well that's a good start anyway.
I'll switch to doing that when I'm just checking what's available.
Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants