ilcorsaroblu: Update regex for better title parsing... (#3532)

Italian release suck, you can find S01E01 or 01x01 or even S01 E01.
So removed S and E from search (this bring in extra results) then try to parse and reconstruct the results
Hope for now is enough to have a better search, at least on Italian tracker, for the external tracker (where are present Italian release too), only god can tell ... Sonarr will parse the result during a rss sync, but during a search I think no result will present ... There are 2 possible solution
1. Find and eliminate all release that don't respect the standard
2. Make Jackett / Sonarr / Radarr a little smartest and include a kind of regional substitution during a searching phase
This commit is contained in:
Jorman 2018-08-05 18:42:17 +02:00 committed by kaso17
parent aa3fa8717f
commit 495afb91e9
1 changed files with 24 additions and 27 deletions

View File

@ -53,15 +53,12 @@
paths: paths:
- path: /index.php - path: /index.php
keywordsfilters: keywordsfilters:
- name: re_replace
args: ["S[0-9]{2}([^E]|$)", ""] # remove season tag without episode (search doesn't support it)
- name: diacritics - name: diacritics
args: replace args: replace
# most ITA TV torrents are in XXxYY format, so we search without S/E prefixes and filter later - name: re_replace # S01 to 1
- name: re_replace args: ["\\b[sS]0*(\\d+)\\b", "$1"]
args: ["S0?(\\d{1,2})", " $1 "] - name: re_replace # S01E01 to 1 1
- name: re_replace args: ["\\b[sS]0*(\\d+)[eE]0*(\\d+)\\b", "$1 $2"]
args: ["E(\\d{2,3})", " $1 "]
inputs: inputs:
search: "{{ .Keywords }}" search: "{{ .Keywords }}"
category: "{{range .Categories}}{{.}};{{end}}" category: "{{range .Categories}}{{.}};{{end}}"
@ -72,28 +69,28 @@
fields: fields:
title: title:
selector: td:nth-child(2) > a selector: td:nth-child(2) > a
# normalize to SXXEYY format
filters: filters:
- name: re_replace # replace special characters with " " (space) - name: re_replace # replace special characters with " " (space)
args: ["[^a-zA-Z0-9]|\\.", " "] args: ["[^a-zA-Z0-9\\s]|\\.", " "]
- name: re_replace # replace multiple spaces
args: ["[ ]{2,}", " "]
# normalize to SXXEYY format # normalize to SXXEYY format
- name: re_replace - name: re_replace # S01 E01 to S01E01
args: ["(\\d{2})x(\\d{2})", "S$1E$2"] args: ["\\b[sS](\\d+)\\s[eE](\\d+)\\b", "S$1E$2"]
- name: re_replace - name: re_replace # 01x01 to S01E01
args: ["(\\d{1})x(\\d{2})", "S0$1E$2"] args: ["(\\d{2})x(\\d+)", "S$1E$2"]
- name: re_replace #Stagione X --> S0X - name: re_replace # 1x01 to S01E01
args: ["Stagione (\\d{0,1}\\s)", "S0$1"] args: ["\\b(\\d{1})x(\\d+)", "S0$1E$2"]
- name: re_replace #Stagione XX --> SXX - name: re_replace # Stagione X --> S0X
args: ["Stagione (\\d{2}\\s)", "S$1"] args: ["\\b[sS]tagion[eiEI]\\s?(\\d{1})\\b|\\b[sS]eason\\s?(\\d{1})\\b", "S0$1"]
- name: re_replace #/ Episodio [YY-YY --> EYY-YY - name: re_replace # Stagione XX --> SXX
args: ["(\\s\\/\\sEpisodio|\\s\\/\\sEpisodi|\\sEpisodio|\\s\\|\\sEpisodio|\\sEpisodi)\\s\\[", "E"] args: ["\\b[sS]tagion[eiEI]\\s?(\\d{2,})\\b|\\b[sS]easons?\\s?(\\d{2,})\\b", "S$1"]
- name: re_replace #/ Completa [episodi YY-YY --> EYY-YY - name: re_replace # Episodio 4 to E4
args: ["(\\s\\/\\sCompleta\\s\\[episodi\\s)", "E"] args: ["\\b([\\/\\|]?[eE]pisodio\\s?(\\d+)|[Pp]untata\\s?(\\d+))", "E$2$3"]
- name: re_replace #remove di YY] | remove /YY] - name: re_replace # Episodi 4 5 to E04-05
args: ["(\\sdi\\s\\d{1,2}|\\/\\d{1,2})\\]", " "] args: ["\\b(?:[Pp]untat[eE]\\s*)(\\d+)\\s?(\\d+)", "E0$1-0$2"]
- name: re_replace #remove various - name: re_replace # rimozioni varie
args: ["(Serie completa|Completa|\\[in pausa\\])", ""] args: ["([Ss]erie completa|[cC]ompleta[tT]?[aA]?|COMPLETA[TA]?|in pausa)", ""]
# fine prova
download: # handle torrents with normal torrent file download download: # handle torrents with normal torrent file download
optional: true optional: true
selector: a[href^="download.php?id="] selector: a[href^="download.php?id="]
@ -135,7 +132,7 @@
- name: querystring - name: querystring
args: category args: category
details: details:
selector: td:nth-child(2) a selector: td:nth-child(2) > a
attribute: href attribute: href
banner: banner:
optional: true optional: true