diff --git a/src/Jackett.Common/Definitions/backups.yml b/src/Jackett.Common/Definitions/backups.yml index c87507b5e..0e9d2aef7 100644 --- a/src/Jackett.Common/Definitions/backups.yml +++ b/src/Jackett.Common/Definitions/backups.yml @@ -122,11 +122,10 @@ search: args: category title_default: selector: a[href*="/details.php?id="] - title_optional: - optional: true - selector: div.tooltip-content > div title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + selector: div.tooltip-content > div + optional: true + default: "{{ .Result.title_default }}" details: selector: a[href*="/details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/bestcore.yml b/src/Jackett.Common/Definitions/bestcore.yml index 59334dc17..1a378125b 100644 --- a/src/Jackett.Common/Definitions/bestcore.yml +++ b/src/Jackett.Common/Definitions/bestcore.yml @@ -135,13 +135,12 @@ search: title_default: # can be abbreviated selector: a[href^="details.php?id="] - title_optional: + title: # usually full length selector: a[href^="details.php?id="] attribute: title optional: true - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/bithumen.yml b/src/Jackett.Common/Definitions/bithumen.yml index d8cbfc2d3..f3cb16816 100644 --- a/src/Jackett.Common/Definitions/bithumen.yml +++ b/src/Jackett.Common/Definitions/bithumen.yml @@ -87,12 +87,11 @@ search: args: "/invalid.torrent" title_default: selector: a[href^="details.php?id="] - title_optional: - optional: true + title: selector: a[href^="details.php?id="] attribute: title - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + optional: true + default: "{{ .Result.title_default }}" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/magicheaven.yml b/src/Jackett.Common/Definitions/magicheaven.yml index 7bd58d3bb..ef194a6f0 100644 --- a/src/Jackett.Common/Definitions/magicheaven.yml +++ b/src/Jackett.Common/Definitions/magicheaven.yml @@ -154,12 +154,11 @@ search: title_default: # is often abbreviated selector: a[href*="torrent-details-"] - title_optional: + title: # usually longer than details title selector: div[id^="port-content-"] div optional: true - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" details: selector: a[href*="torrent-details-"] attribute: href diff --git a/src/Jackett.Common/Definitions/majomparade.yml b/src/Jackett.Common/Definitions/majomparade.yml index cf2f96c87..57dde03b9 100644 --- a/src/Jackett.Common/Definitions/majomparade.yml +++ b/src/Jackett.Common/Definitions/majomparade.yml @@ -111,15 +111,14 @@ search: title_default: selector: a[href^="details.php?id="] > b attribute: title - title_optional: + title: selector: a[href^="details.php?id="] > b[title*="Torrent neve:"] - optional: true attribute: title + optional: true + default: "{{ .Result.title_default }}" filters: - name: regexp args: "Torrent neve: (.*?)<" - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" _descr: selector: a[href^="details.php?id="] > b attribute: title diff --git a/src/Jackett.Common/Definitions/moviesite.yml b/src/Jackett.Common/Definitions/moviesite.yml index 69935714e..f08870e89 100644 --- a/src/Jackett.Common/Definitions/moviesite.yml +++ b/src/Jackett.Common/Definitions/moviesite.yml @@ -111,11 +111,12 @@ search: title_default: # is often abbreviated selector: a[href^="details.php?id="] - title_optional: + title: # usually longer than details title selector: a[href*="download.php?id="]:has(img[src="../pic/yes.png"]) attribute: title optional: true + default: "{{ .Result.title_default }}" filters: - name: replace args: ["Download torrent: ", ""] @@ -123,8 +124,6 @@ search: args: ["Torrent letöltése: ", ""] - name: replace args: ["Downloadeaza torentul: ", ""] - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/mvgroupforum.yml b/src/Jackett.Common/Definitions/mvgroupforum.yml index 21578f497..697dbc169 100644 --- a/src/Jackett.Common/Definitions/mvgroupforum.yml +++ b/src/Jackett.Common/Definitions/mvgroupforum.yml @@ -159,12 +159,11 @@ search: fields: category: text: Other - title_default: - # fallback title (to prevent abend if optional is not found) - text: "title not found" - title_optional: - optional: true + title: selector: td.doubleindent, td.singleindent a[href^="/index.php?showtopic="] + optional: true + # fallback title (to prevent abend if optional is not found) + default: "title not found" filters: - name: re_replace args: ["(?i)^BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] @@ -198,8 +197,6 @@ search: args: ["(?i)^Al-Jazeera (.*)", "{{ if .Config.dropbbc }}{{ else }}Al-Jazeera {{ end }}$1"] - name: append args: "{{ if .Config.stripS01E01 }}{{ else }} S01E01{{ end }}" - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" details: optional: true selector: td.singleindent a[href^="/index.php?showtopic="] diff --git a/src/Jackett.Common/Definitions/mvgroupmain.yml b/src/Jackett.Common/Definitions/mvgroupmain.yml index fb6c1e9a2..381bec8b1 100644 --- a/src/Jackett.Common/Definitions/mvgroupmain.yml +++ b/src/Jackett.Common/Definitions/mvgroupmain.yml @@ -159,12 +159,11 @@ search: fields: category: text: Other - title_default: - # fallback title (to prevent abend if optional is not found) - text: "title not found" - title_optional: - optional: true + title: selector: td.doubleindent, td.singleindent a[href^="/index.php?showtopic="] + optional: true + # fallback title (to prevent abend if optional is not found) + default: "title not found" filters: - name: re_replace args: ["(?i)^BBC (.*)", "{{ if .Config.dropbbc }}{{ else }}BBC {{ end }}$1"] @@ -198,8 +197,6 @@ search: args: ["(?i)^Al-Jazeera (.*)", "{{ if .Config.dropbbc }}{{ else }}Al-Jazeera {{ end }}$1"] - name: append args: "{{ if .Config.stripS01E01 }}{{ else }} S01E01{{ end }}" - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" details: optional: true selector: td.singleindent a[href^="/index.php?showtopic="] diff --git a/src/Jackett.Common/Definitions/nyaasi.yml b/src/Jackett.Common/Definitions/nyaasi.yml index 324e6d6d8..5cee2f18c 100644 --- a/src/Jackett.Common/Definitions/nyaasi.yml +++ b/src/Jackett.Common/Definitions/nyaasi.yml @@ -148,14 +148,13 @@ search: args: ["=", -1] title_default: selector: td:nth-child(2) a:last-of-type - title_optional: + title: selector: td:nth-child(2) a:last-of-type:contains("[PuyaSubs!] ") optional: true + default: "{{ .Result.title_default }}" filters: - name: append args: " Spanish" - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" details: selector: td:nth-child(2) a:last-of-type attribute: href diff --git a/src/Jackett.Common/Definitions/oldtoonsworld.yml b/src/Jackett.Common/Definitions/oldtoonsworld.yml index 14c19ff58..8a5b526ba 100644 --- a/src/Jackett.Common/Definitions/oldtoonsworld.yml +++ b/src/Jackett.Common/Definitions/oldtoonsworld.yml @@ -120,12 +120,11 @@ search: args: cat title_default: selector: a[href^="details.php?id="] - title_optional: - optional: true + title: selector: a[title][href^="details.php?id="] attribute: title - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + optional: true + default: "{{ .Result.title_default }}" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/p2pbg.yml b/src/Jackett.Common/Definitions/p2pbg.yml index 226023ddd..8d698048e 100644 --- a/src/Jackett.Common/Definitions/p2pbg.yml +++ b/src/Jackett.Common/Definitions/p2pbg.yml @@ -135,18 +135,17 @@ search: title_default: # often abbreviated selector: td:nth-child(2) a - title_optional: + title: # usually full length selector: td a[title] attribute: title optional: true + default: "{{ .Result.title_default }}" filters: - name: replace args: ["View details: ", ""] - name: replace args: ["Преглед на детайли: ", ""] - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" details: selector: td a[href*="id="] attribute: href diff --git a/src/Jackett.Common/Definitions/pignetwork.yml b/src/Jackett.Common/Definitions/pignetwork.yml index 48a961429..461f39336 100644 --- a/src/Jackett.Common/Definitions/pignetwork.yml +++ b/src/Jackett.Common/Definitions/pignetwork.yml @@ -120,12 +120,11 @@ search: args: cat title_default: selector: a[href^="details.php?id="] - title_optional: - optional: true + title: selector: a[title][href^="details.php?id="] attribute: title - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + optional: true + default: "{{ .Result.title_default }}" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/punkshorror.yml b/src/Jackett.Common/Definitions/punkshorror.yml index 49d76db49..5b4febf8e 100644 --- a/src/Jackett.Common/Definitions/punkshorror.yml +++ b/src/Jackett.Common/Definitions/punkshorror.yml @@ -113,13 +113,12 @@ search: title_default: # can be abbreviated selector: a[href^="details.php?id="] - title_optional: + title: # usually full length selector: a[href^="details.php?id="] attribute: title optional: true - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" details: selector: a[href^="details.php?id="] attribute: href diff --git a/src/Jackett.Common/Definitions/slosoul.yml b/src/Jackett.Common/Definitions/slosoul.yml index 2b3285096..66403868c 100644 --- a/src/Jackett.Common/Definitions/slosoul.yml +++ b/src/Jackett.Common/Definitions/slosoul.yml @@ -122,12 +122,11 @@ search: title_default: # is often abbreviated selector: a[href*="torrent-details-"] - title_optional: + title: # usually longer than details title selector: div[id^="port-content-"] div optional: true - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" details: selector: a[href*="torrent-details-"] attribute: href diff --git a/src/Jackett.Common/Definitions/tasmanit.yml b/src/Jackett.Common/Definitions/tasmanit.yml index 11d43ba09..950c8a4d1 100644 --- a/src/Jackett.Common/Definitions/tasmanit.yml +++ b/src/Jackett.Common/Definitions/tasmanit.yml @@ -118,11 +118,10 @@ search: fields: title_default: selector: td:nth-child(2) a - title_optional: - optional: true - selector: div.tooltip-content > div title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + selector: div.tooltip-content > div + optional: true + default: "{{ .Result.title_default }}" category: selector: a[href*="/browse.php?category="] attribute: href diff --git a/src/Jackett.Common/Definitions/torrent9.yml b/src/Jackett.Common/Definitions/torrent9.yml index 288a91aa1..cd0e5c0b0 100644 --- a/src/Jackett.Common/Definitions/torrent9.yml +++ b/src/Jackett.Common/Definitions/torrent9.yml @@ -141,12 +141,11 @@ search: i[class="fa fa-book"]: ebook title_default: selector: td:nth-child(1) a - title_optional: + title_phase1: selector: td:nth-child(1) a[title] attribute: title optional: true - title_phase1: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" filters: - name: re_replace args: ["(?i)\\b(FRENCH|MULTI|TRUEFRENCH|VOSTFR|SUBFRENCH)\\b(.+?)(\\b(19|20\\d{2})\\b)$", "$3 $1$2"] diff --git a/src/Jackett.Common/Definitions/whiteangel.yml b/src/Jackett.Common/Definitions/whiteangel.yml index 9d82ab00a..4aa5889e9 100644 --- a/src/Jackett.Common/Definitions/whiteangel.yml +++ b/src/Jackett.Common/Definitions/whiteangel.yml @@ -118,13 +118,12 @@ search: title_default: # can be abbreviated selector: a[href^="javascript:torrent"] b - title_optional: + title: # usually full length selector: a[href^="javascript:torrent"] attribute: title optional: true - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" _id: selector: a[href^="javascript:torrent"] attribute: href diff --git a/src/Jackett.Common/Definitions/yts.yml b/src/Jackett.Common/Definitions/yts.yml index 531bebd39..afdcc0ef1 100644 --- a/src/Jackett.Common/Definitions/yts.yml +++ b/src/Jackett.Common/Definitions/yts.yml @@ -95,11 +95,10 @@ search: filters: - name: append args: " ({{ .Result.year }})" - title_optional: + title: selector: ..title_long optional: true - title: - text: "{{ if .Result.title_optional }}{{ .Result.title_optional }}{{ else }}{{ .Result.title_default }}{{ end }}" + default: "{{ .Result.title_default }}" filters: - name: replace args: [":", ""]