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

API search does not work with Params unless using torznab #15009

Closed
3 tasks done
swannie-eire opened this issue Jan 22, 2024 · 3 comments
Closed
3 tasks done

API search does not work with Params unless using torznab #15009

swannie-eire opened this issue Jan 22, 2024 · 3 comments
Labels

Comments

@swannie-eire
Copy link
Contributor

swannie-eire commented Jan 22, 2024

Have you checked our Troubleshooting page for your issue?

  • I have checked the Troubleshooting page

Is there already an issue for your problem?

  • I have checked older issues, open and closed

Have you read our Contributing Guidelines?

  • I have read the Contributing Guidelines

Environment

running in docker container.
latest -  Jackett Version v0.21.1588

Description

After like 5 hours trying to build the Jackett enviroment in visual studio i gave up and am just going to mitigate this issue using a custom qbittorrent.

when using the API is there a way to use the params to get the results back in JSON vs RSS/torznab as i can only get the search query to work.

this works and gives me a json response Note query being used instead of q.
http://10.0.0.125:9117/api/v2.0/indexers/retroflix/results?apikey=API_KEY&query=tt2362006

this search just gives me the last 100 torrents uploaded so the param imdbid does not actually work. (i also tested with other params on other indexers and got the same result)
http://10.0.0.125:9117/api/v2.0/indexers/retroflix/results?apikey=API_KEY&imdbid=tt2362006

using torznab this works but is in torznab/rss format
http://10.0.0.125:9117/api/v2.0/indexers/retroflix/results/torznab?apikey=API_KEY&imdbid=tt2362006

I assume the full endpoint is http://IP_ADDRESS:9117/api/v2.0/indexers/retroflix/results/api?apikey=APIKEY&t=movie&cat=2&imdbid=tt1234567 as thats what it looks like from the docs but that does not work either.
https://github.com/Jackett/Jackett#search-modes-and-parameters

Can something like example from the docs.../api?apikey=APIKEY&t=movie&cat=2&imdbid=tt1234567 work with a JSON response or does it have to be torznab? as it does not work for me `http://10.0.0.125:9117/api/v2.0/indexers/retroflix/results/api?apikey=APIKEY&t=movie&cat=2&imdbid=tt1234567

i am trying to pull this data into a custom application and having the format in JSON makes parsing out the info so much easier.

Logged Error Messages

I dont see any logs generated even with verbose enabled when querying with `http://10.0.0.125:9117/api/v2.0/indexers/retroflix/results?apikey=API_KEY&imdbid=tt2362006`

Screenshots

no logged errors

@swannie-eire swannie-eire changed the title API search does not work with Params API search does not work with Params unless using torznab Jan 22, 2024
@ilike2burnthing
Copy link
Contributor

ilike2burnthing commented Jan 22, 2024

The search modes and parameters are for the torznab endpoint, and it returns an XML RSS feed.

Our API can use either:

api/v2.0/indexers/retroflix/results?apikey=API_KEY&query=tt2362006

api/v2.0/indexers/all/results?apikey=API_KEY&Tracker[]=retroflix&Category[]=&Query=tt2362006

It returns JSON and does not support those search modes and parameters.


What issue were you having with Visual Studio?

@swannie-eire
Copy link
Contributor Author

The search modes and parameters are for the torznab endpoint, and it returns an XML RSS feed.

Our API can use either:

api/v2.0/indexers/retroflix/results?apikey=API_KEY&query=tt2362006

api/v2.0/indexers/all/results?apikey=API_KEY&Tracker[]=retroflix&cat=&Query=tt2362006

It returns JSON and does not support those search modes and parameters.

What issue were you having with Visual Studio?

are the only params supported with a JSON response Tracker, cat and query?

cant remember the exacy error as it was last week and i since deleted the windows VM i was working on but basically visual studio gives me an error saying i dont have the correct libraries installed to build/compile the project to get the exe even though i do. been nearly 10 years since i worked with C#/VS and it totally different now so gave up after like half a day searching online in how to fix.

@ilike2burnthing
Copy link
Contributor

are the only params supported with a JSON response Tracker, cat and query?

Whoops, edited above, it should have been Category[], but yea:

foreach (var t in Request.Query)
{
if (t.Key == "Tracker[]")
{
request.Tracker = t.Value.ToString().Split(',');
}
if (t.Key == "Category[]")
{
request.Category = t.Value.ToString().Split(',').Select(int.Parse).ToArray();
CurrentQuery.Categories = request.Category;
}
if (t.Key == "query")
{
request.Query = t.Value.ToString();
}
}

Were you following the contributing guide for setting up the environment?
https://github.com/Jackett/Jackett/blob/master/CONTRIBUTING.md#contributing-code

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

No branches or pull requests

2 participants