Jackett / Jackett

API Support for your favorite torrent trackers
GNU General Public License v2.0
11.59k stars 1.26k forks source link

[Enchancement] Add a way to set map language tag #11014

Open w1zz4 opened 3 years ago

w1zz4 commented 3 years ago

There is already an option to change MULTI for a few Tracker (Like yggtorrents). But there are some custom language tags for regionalized version.

A good example is VFQ which stand for Version Française Québécois (French Canadian Version). It will be good to have a text box where someone can just put VFQ then choose the corresponding language FRENCH so the client get the right language information.

There was something similar already discussed in Issues, look at https://github.com/Jackett/Jackett/issues/5279

xfouloux commented 3 years ago

If i understand correctly you want the parser to ADD or REPLACE VFQ by FRENCH like in this example :

on tracker : Subito.texto.SAISON.5.VFQ.WEB-DL.480p.x264-ROLLED on jackett : ADD -> Subito.texto.SAISON.5.VFQ.FRENCH.WEB-DL.480p.x264-ROLLED REPLACE -> Subito.texto.SAISON.5.FRENCH.WEB-DL.480p.x264-ROLLED

Maybe also for VFF ?

w1zz4 commented 3 years ago

The issue right now is that VFF or VFQ are not considered as language by download app.

At first I thought a settings like the one in yggtorrents to map MULTI with a langague could be a good idea. But now that you are talking about adding FRENCH avec VFQ or VFF is a better idea. You still can see if it's quebecois or not release but downloader will see it as french

xfouloux commented 3 years ago

i'll probably make a PR soon for all this when there is approval of modification about the following by some people like @garfield69 @ilike2burnthing @ngosang

  1. First change Let say we add a checkbox option that say Add .FRENCH to any instance of word "VFF" / "VFQ"

  2. Second change for multi it match only "(?i)(\\smulti\\s)" if MULTI is at end of title, it won't match so need to add another regex "(?i)(\\smulti$)"

Also need to match this terms

VFF+VO
VFF + VO
VO+VFF
VO + VFF
TRUEFRENCH + VO
TRUEFRENCH+VO

we could include this too but then it would interfere with the request in this issue

VO+VFQ
VO + VFQ

same for vostfr regex it matches

"(?i)(\\svostfr\\s)" and "(?i)(\\ssubfrench\\s)" we need to match at end too "(?i)(\\svostfr$)" and "(?i)(\\ssubfrench$)"

  1. More changes We should make a class/method idk in jackett code in order to make it once, and pull it in all configs easily C# and YML both, i'm not too sure how to do this but i'll look into it, because having to change the code in X .yml files is tedious

i'm guessing add some methods to this file ? https://github.com/Jackett/Jackett/blob/eaf0513605c3f8e982c36617ca43555f2ac7a5e4/src/Jackett.Common/Indexers/Meta/ResultFilters.cs#L8-L20 and then here : https://github.com/Jackett/Jackett/blob/eaf0513605c3f8e982c36617ca43555f2ac7a5e4/src/Jackett.Common/Models/IndexerDefinition.cs#L50-L58 and the regex functions in this file https://github.com/Jackett/Jackett/blob/eaf0513605c3f8e982c36617ca43555f2ac7a5e4/src/Jackett.Common/Utils/ParseUtil.cs#L6-L20

i'm missing stuff for sure, if someone would help me point to the right direction =)

w1zz4 commented 3 years ago

This is cool and address my request properly.

But wouldn’t be better to add a general option available to all trackers where user can do their own matching regex and replacent string?

xfouloux commented 3 years ago

This is cool and address my request properly.

But wouldn’t be better to add a general option available to all trackers where user can do their own matching regex and replacent string?

Yes i updated my comments multiple time regarding this

ilike2burnthing commented 3 years ago

@xfouloux are you planning to have this as an optional user-configurable setting which can be added per indexer, but without having to also add lines upon lines of replace and re_replace title filters each time (because this would be called from elsewhere)?

YGG being the obvious example, but also much more extensive versions such as HD-Forever: https://github.com/Jackett/Jackett/blob/eaf0513605c3f8e982c36617ca43555f2ac7a5e4/src/Jackett.Common/Definitions/hdforever.yml#L199-L254

xfouloux commented 3 years ago

@ilike2burnthing yes i would like this to be an optional user-configurable setting in the settings block

you would have something like

settings:
  - name: username
    type: text
    label: Username
  - name: password
    type: password
    label: Password
  - name: multiandvostfrregex

or directly a global setting maybe ?

---
id: hdforever
name: HD-Forever
description: "HD-Forever (HD-F) is a FRENCH Private Torrent Tracker for HD MOVIES"
language: fr-fr
type: private
encoding: UTF-8
links:
  - https://hdf.world/
multiandvostfrregex: true

this would then display automatically in the indexer config the checkboxes and select lists and do the regexes after on results, this way we would have only 1 place in the code to change regex and match patterns for this, instead of in each indexer, where as you can see, hdforever has better regex than ygg or sharewood for example.

ilike2burnthing commented 3 years ago

The first option would seem more suitable.

Just wondering if this could be made to work with other languages as well (Spanish comes to mind), e.g.

  - name: multilang
    arg: french

and rules would be used specific to each language.

Obviously arg: doesn't work in settings, so just using it to give a rough idea.

xfouloux commented 3 years ago

Indeed ! Obviously a great idea !

then we would create a file in the dir Jackett/src/Jackett.Common/Utils/ for each supported lang, and put functions in there i think In /src/Jackett.Common/Utils/ParseUtil.cs we would have the method, calling function with lang and args

definitely worth it

i have to go to work now, but i'll do a WIP PR in the next day, or days

xfouloux commented 3 years ago

reviewing the code, it's easier, and maybe better to add it as a global option, because in settings bloc, you have to give it a name, type, and label and optionnaly a default param, because it's how it's constructed; Moreover, you would be able to add multiple blocs using multiple times the same type so meh.

i'm currently trying to add this "extraoption" yaml selector, it would look like this

---
id: sharewood
name: Sharewood
description: "sharewood is a Semi-Private FRENCH Torrent Tracker for GENERAL"
language: fr-fr
...
...
caps:
  categorymappings:
    - {id: "Films", cat: Movies, desc: "Films"}
...
  modes:
    search: [q]
...
...
extraoptions:
  - freeleech (bool)
  - regexlang: string LANG
...
...
settings:
  - name: username

the "freeleech" option would obviously add the checkbox freeleech to be checked or not on indexer config, and then filter results to only display downloadfactor=0 results

the "regexlang" option would display the block image and apply regex depending on the LANG selected as arg.

what other options would be great there that are redundant ?

ilike2burnthing commented 3 years ago

Would freelech be doable, given that it's usually specific to the engine or tracker, in some cases just filtering results after they're returned? Or would it just replace:

  - name: freeleech
    type: checkbox
    label: Search freeleech only
    default: false

If the latter, I don't think it's necessary.

xfouloux commented 3 years ago

well my idea about freeleech, is yeah it would automatically add a setting bloc

  - name: freeleech
    type: checkbox
    label: Search freeleech only
    default: false

but also, to know if a file is freeleech or not, you just have to filter on the return of value downloadratio, which may or may not be modified by the filtering or whatever you do regarding the tracker. But if it is not configured, the value is 1 by default. So you just have to filter results and display only results that have downloadratio = 0 when freeleech checkbox is ticked.

So the way to modify the output of the downloadratio is up to the tracker config

Tristan-2i commented 1 year ago

hi, did you find a solution ? is there a way to download only vff and not vfq ?

w1zz4 commented 1 year ago

hi, did you find a solution ? is there a way to download only vff and not vfq ?

I moved to a alternate software since. This was not the main reason btw.

Tristan-2i commented 1 year ago

hi, did you find a solution ? is there a way to download only vff and not vfq ?

I moved to a alternate software since. This was not the main reason btw.

Oh.. I found that the option to map VFQ as FRENCH is available for "lesaloon" indexer so I think it can be the same for ygg. My problem is that i don't want to download VFQ version. For exemple a file like MULTI.VFQ is transformed like FRENCH.VFQ but I don't want VFQ files only VFF, what should I do ?

ilike2burnthing commented 1 year ago

Create a new release profile with a must not contain restriction for VFQ in Sonarr.

Tristan-2i commented 1 year ago

Create a new release profile with a must not contain restriction for VFQ in Sonarr.

I'm sorry but how to create a release profile in radarr ? I don't see "must not contain" in quality profile, but thank you for Sonarr

ilike2burnthing commented 1 year ago

Use Custom Formats in Radarr and enable the Negate setting for it.

Tristan-2i commented 1 year ago

Use Custom Formats in Radarr and enable the Negate setting for it.

Thank you I discover the functionalities of the personalized format. For my specific use I just found it under Settings/Indexers/Restrictions

mynameisbogdan commented 2 weeks ago

FYI Radarr and Sonarr now both have support to define Multi Languages per indexer for releases that contain Multi.