Skip to content

Commit

Permalink
assorted yml: optional title tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
garfield69 committed Mar 20, 2023
1 parent e689e94 commit bffb505
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 68 deletions.
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/backups.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/bestcore.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/bithumen.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/magicheaven.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/majomparade.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/moviesite.yml
Expand Up @@ -111,20 +111,19 @@ 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: ", ""]
- name: replace
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
Expand Down
11 changes: 4 additions & 7 deletions src/Jackett.Common/Definitions/mvgroupforum.yml
Expand Up @@ -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"]
Expand Down Expand Up @@ -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="]
Expand Down
11 changes: 4 additions & 7 deletions src/Jackett.Common/Definitions/mvgroupmain.yml
Expand Up @@ -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"]
Expand Down Expand Up @@ -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="]
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/nyaasi.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/oldtoonsworld.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/p2pbg.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/pignetwork.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/punkshorror.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/slosoul.yml
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Jackett.Common/Definitions/tasmanit.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/torrent9.yml
Expand Up @@ -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"]
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/whiteangel.yml
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/Jackett.Common/Definitions/yts.yml
Expand Up @@ -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: [":", ""]
Expand Down

0 comments on commit bffb505

Please sign in to comment.