Jackett icon indicating copy to clipboard operation
Jackett copied to clipboard

[REQ] Add support for searching seasons with "season" string

Open Codebreaker101 opened this issue 3 years ago • 11 comments

Read and complete in full with information about your setup and issue before submitting.

Do not delete the template.

Please use the search bar at the top of the page and make sure you are not creating an already submitted issue. Check closed issues as well, because your issue may have already been fixed. Also check our Troubleshooting for steps to resolve common issues.

Please read our Contributing Guidelines before submitting your issue to ensure a prompt response to your bug.

Environment

OS: docker - linuxserver/jackett

.Net Runtime: Mono 5.20.1.34

.Net Version: N/A

Jackett Version: 3.0.6.1196

Last Working Jackett Version: N/A

Are you using a proxy or VPN? no

Description

Seasons are searched only with "Sxx" string. There are season packs that have "Season X" in the title and therefore not shown in the search results using that query string.

Logged Error Messages

2021-05-03 11:03:21.6672 Debug WebClient(HttpWebClient2).GetResultAsync(Method: GET Url: https://www.torrentleech.org/torrents/browse/list/exact/1/query/Stargate+Atlantis+S03/categories/26,32)
2021-05-03 11:03:21.6434 Debug WebClient(HttpWebClient2).GetResultAsync(Method: GET Url: https://iptorrents.com/t?q=Stargate+Atlantis+S03&73=&26=&55=&78=&23=&24=&25=&66=&82=&65=&83=&79=&22=&5=&99=&4=&60=) 

Codebreaker101 avatar May 03 '21 09:05 Codebreaker101

Is this req just for TL and IPT, or for all indexers?

Going by your 'Jackett' version number, this is in relation to Sonarr and how they search, as you can enter whatever search you want in Jackett.

To search for both S03 and Season 3 we'd have to do two separate searches every time, resulting it duplicate results for all searches that don't contain Sxx, double the time taken, double the traffic, and potentially getting accounts flagged for bot activity (not sure of the policies for those trackers, so that might be unlikely, but still worth considering).

Depending on how many results are returned it might also be pointless, as Sonarr will only accept the first 100.

This may be more appropriate to take up with Sonarr.

ilike2burnthing avatar May 03 '21 21:05 ilike2burnthing

Sorry about the wrong versions. Was looking at the wrong tab. It is v0.17.996.

From what I understand, sonarr sends an API call to the jackett v2.0 torznab API endpont which in turn formats "&season=3" from the GET request to the "S03" that is used when searching. Is that correct?

To search for both S03 and Season 3 we'd have to do two separate searches every time, resulting it duplicate results for all searches that don't contain Sxx, double the time taken, double the traffic, and potentially getting accounts flagged for bot activity

That is true. But I would argue that when running a search for a whole season per episode in sonarr I have 24 searches running at the same time, and that does not seem to create a problem.

Season 3 vs S03 is only a problem when running a season search and not episode search because most of the time episodes are formatted correctly (S03E12 vs Season 3 E12 / Season 3 Episode 12). I haven't dived deep into the source code but I was thinking if there is only a season search ie. when api call is missing episode query parameter then run 2x the search (SXX and season x).

Regarding the double the results, I did a couple of searches for different TV show and I didn't ran into any duplicated search results. Maybe because those that have "Season 1" in the title don't have "S01" and vice versa

http://jackett:9117/api/v2.0/indexers/iptorrents/results/torznab/api?t=tvsearch&cat=5000,5010,5020,5030,5040,5060,5070,5080,100073,100078,100023,100026,100024,100025,100066,100082,100065,100083,100079,100022,100005,100099,100004&extended=1&apikey=<redacted>&offset=0&limit=100&q=Stargate%20Atlantis&season=3

Codebreaker101 avatar May 04 '21 07:05 Codebreaker101

OK, I think I get you now.

If this was for an individual indexer, it would be a case of us setting up 2 search paths which would always be used no matter what is being searched; Stargate Atlantis S03, or The Joker, or abcde12345. In the 1 public YAML indexer where we do this, the first search uses S03 and second uses Season 03, but if Sxx isn't part of keywords then there's nothing to change, so you just end up with duplicate results.

Presumably in a C# indexer there would be a way round this, e.g. only running the second altered search if the format Sxx is used, or running a second search but just pulling the second page of results so as to avoid duplicates. There are no C# indexers doing this, so that's a bit of a guess.

Your suggestion however is when Jackett receives an API call for ...&q=xxxx&season=x, but not ...&q=xxxx&season=x&ep=x, to run two searches, one for Sxx and another for season x, no matter the indexer. Is that correct?

This would double the time taken and traffic only in that scenario, rather than all searches, and given that it's only done manually, should be rare enough to not get accounts flagged. There's still a chance that you end up with more results than Sonarr can deal with, but that's extremely unlikely.

ilike2burnthing avatar May 04 '21 16:05 ilike2burnthing

Your suggestion however is when Jackett receives an API call for ...&q=xxxx&season=x, but not ...&q=xxxx&season=x&ep=x, to run two searches, one for Sxx and another for season x, no matter the indexer. Is that correct?

Yes, that is correct.

Codebreaker101 avatar May 04 '21 18:05 Codebreaker101

I think it need to be configurable as you can have season term in other language ... for example, my tracker have saison word in french like here : https://www.oxtorrent.ph/recherche/breaking%20bad image

ioull avatar May 20 '21 13:05 ioull

I personally do not think this is qualified as a core issue. This will probably not be added to all trackers, but perhaps to certain trackers only.

Firstly, certain trackers would have rulings enforced to ensure consistency. On the other hand, some trackers may allow releases in both formats, SXX and Season XX.

Secondly, if we're talking about using Torznab protocol here, there's nothing much that Jackett can do to infer it should search both SXX and Season XX. Jackett will initially parse the URL query string and map them to its respective variables. It then passes on this mapping to each individual indexer. It's then up to the indexers to decide how to submit this query string to the trackers. In this case, IPTorrents's C# indexer should consider searching for both SXX and Season XX.

To Jackett's URL query string parser, season=3 query will always be Season 3 in the mapping, and there's no way to tell indexers to use Season XX or SXX. It's up to the indexer code to determine if a second search request has to be done or not.

I recommend listing down trackers that do this and have this implemented in each one of them individually. I do not see this to be practical if implemented globally.

seeyabye avatar Jun 10 '21 06:06 seeyabye

I was thinking some optional setting like seasondual, e.g.:

---
id: yggtorrent
name: YGGtorrent
description: "YGGTorrent is a FRENCH Semi-Private Torrent Tracker for 0DAY / GENERAL"
language: fr-fr
type: semi-private
encoding: UTF-8
followredirect: true
seasondual: saison
links:
  - https://www4.yggtorrent.li/

which would only affect TV season/season&ep searches, and would avoid having to use:

  paths:
    - path: "engine/search?category={{ .Config.category }}&name={{ .Keywords }}&description=&file=&uploader=&sub_category=&do=search&order={{ .Config.type }}&sort={{ .Config.sort }}"
      followredirect: true
    # Saison Word
    - path: "engine/search?category={{ .Config.category }}&name={{ if .Keywords }}{{ re_replace .Keywords \"[sS]0(\\d{1,2})\"  \"Saison.$1\"}}{{ else }}&page=50{{ end }}&description=&file=&uploader=&sub_category=&do=search&order={{ .Config.type }}&sort={{ .Config.sort }}"
      followredirect: true

for every search, resulting in duplicate searches when there is no Sxx in the keywords.

It could also allow searching for both Sxx and seizoen xx in cases like https://github.com/Jackett/Jackett/issues/11170 where the lack of nested functions support prevents the use of the current workaround (actually in this case we'd need seasondual: seizoen and epdual: afl).

This would presumably require, in part, a change to: https://github.com/Jackett/Jackett/blob/48e85564c8357bf212d39212e4b160ab7dae72fc/src/Jackett.Common/Models/DTO/ApiSearch.cs#L22-L33 as well as IndexerDefinition, BaseIndexer and CardiganIndexer.

If that's not a 'core' change then my bad, a misunderstanding of the term on my part.

ilike2burnthing avatar Jun 10 '21 15:06 ilike2burnthing

@ilike2burnthing

Thank you for the detail explanation. Indeed this would require changes in some of the core codes. It always occur to me that I forgot about cardigans indexers. I will take a look at this probably submit a PR.

seeyabye avatar Jun 11 '21 08:06 seeyabye

Just commenting to see if there's been any changes or updates to this as one of the main indexers I use, results are not being picked up because it's searching the indexer incorrectly.

Feels pretty stupid that after searching for the show on Sonarr, expecting Jackett to search the indexers correctly only to then not have it show any useful results and then finding out the whole show was there just because it searched Sxx instead of Season xx.

image

image

Ty-Grr avatar Jan 28 '22 22:01 Ty-Grr

Searching TorrentGalaxy for ancient aliens s15 returns 26 results, just none of them are season packs. You may want to change your selected categories if you're getting 0.

Searching just for ancient aliens returns 211 results. Searching ancient aliens season returns only 19 results from 2 uploaders.

Even when the above req is implemented, it will not be used for TorrentGalaxy. Jackett is not searching incorrectly, rather a few uploaders use naming formats inconsistent with the vast majority of uploads to the site.

ilike2burnthing avatar Jan 29 '22 02:01 ilike2burnthing

ive got all the categories on for both jsckett and sonarr for TG that uploader I believes only uploads to that site and using Season xx instead of Sxx

if there's no way to change that, that's fine then ill just have to search it again on TG

thanks for reply

Ty-Grr avatar Jan 29 '22 08:01 Ty-Grr