assorted yml: use default: statement for optional fields (#14179)

This commit is contained in:
ilike2burnthing
2023-03-21 21:21:33 +00:00
committed by GitHub
parent 0c5dfd4d62
commit f69879a2ee
13 changed files with 38 additions and 53 deletions

View File

@@ -297,10 +297,11 @@ search:
"[src$=\"/Scripts.png\"]": 128 "[src$=\"/Scripts.png\"]": 128
"[src$=\"/Vetores.png\"]": 124 "[src$=\"/Vetores.png\"]": 124
"[src$=\"/outros2.png\"]": 130 "[src$=\"/outros2.png\"]": 130
date_optional: date:
selector: p:contains("Lançado:") selector: p:contains("Lançado:")
# auto adjusted by site account profile # auto adjusted by site account profile
optional: true optional: true
default: now
filters: filters:
- name: regexp - name: regexp
args: "Lançado: (.+?)$" args: "Lançado: (.+?)$"
@@ -308,8 +309,6 @@ search:
args: [" (\\d:)", " 0$1"] args: [" (\\d:)", " 0$1"]
- name: dateparse - name: dateparse
args: "dd/MM/yy HH:mm:ss" args: "dd/MM/yy HH:mm:ss"
date:
text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}now{{ end }}"
size: size:
selector: div.list-group-item-content p.m-0 span.badge-info selector: div.list-group-item-content p.m-0 span.badge-info
seeders: seeders:

View File

@@ -88,10 +88,11 @@ search:
selector: article selector: article
fields: fields:
category_optional: category:
optional: true
selector: a[href*="category="] selector: a[href*="category="]
attribute: href attribute: href
optional: true
default: 54
case: case:
a[href$="3d_hentai"]: 51 a[href$="3d_hentai"]: 51
a[href$="3dcg_game"]: 55 a[href$="3dcg_game"]: 55
@@ -110,8 +111,6 @@ search:
a[href$="original_hentai"]: 48 a[href$="original_hentai"]: 48
a[href$="rus-game"]: 57 a[href$="rus-game"]: 57
a[href$="uncensored"]: 45 a[href$="uncensored"]: 45
category:
text: "{{ if .Result.category_optional }}{{ .Result.category_optional }}{{ else }}54{{ end }}"
title: title:
selector: h2.title a selector: h2.title a
details: details:

View File

@@ -86,15 +86,14 @@ search:
selector: div.table-torrents > table > tbody > tr[id^="torrentposter"] selector: div.table-torrents > table > tbody > tr[id^="torrentposter"]
fields: fields:
category_optional: category:
selector: a[href*="/categories/"] selector: a[href*="/categories/"]
optional: true
attribute: href attribute: href
optional: true
default: 1
filters: filters:
- name: regexp - name: regexp
args: "/categories/.*?\\.(\\d+)" args: "/categories/.*?\\.(\\d+)"
category:
text: "{{ if .Result.category_optional }}{{ .Result.category_optional }}{{ else }}1{{ end }}"
title: title:
selector: a.torrent-name selector: a.torrent-name
details: details:

View File

@@ -80,14 +80,13 @@ search:
div[title="Comics"]: 4 div[title="Comics"]: 4
div[title="Ebooks"]: 5 div[title="Ebooks"]: 5
div[title="Magazines"]: 7 div[title="Magazines"]: 7
author_optional:
selector: .authorLink
optional: true
_editor: _editor:
selector: .editorLink selector: .editorLink
optional: true optional: true
author: author:
text: "{{ or .Result.author_optional .Result._editor }}" selector: .authorLink
optional: true
default: "{{ .Result._editor }}"
year: year:
selector: .torYear selector: .torYear
optional: true optional: true

View File

@@ -391,6 +391,7 @@ search:
size_rus: size_rus:
selector: div.shor_subtitles span:nth-child(2):contains("Б") selector: div.shor_subtitles span:nth-child(2):contains("Б")
optional: true optional: true
default: "0 B"
filters: filters:
- name: replace - name: replace
args: ["ТБ", "TB"] args: ["ТБ", "TB"]
@@ -400,11 +401,10 @@ search:
args: ["МБ", "MB"] args: ["МБ", "MB"]
- name: replace - name: replace
args: ["КБ", "KB"] args: ["КБ", "KB"]
size_eng: size:
selector: div.shor_subtitles span:nth-child(2):contains("B") selector: div.shor_subtitles span:nth-child(2):contains("B")
optional: true optional: true
size: default: "{{ .Result.size_rus }}"
text: "{{ if or .Result.size_rus .Result.size_eng }}{{ or .Result.size_rus .Result.size_eng }}{{ else }}0 B{{ end }}"
downloadvolumefactor: downloadvolumefactor:
text: 0 text: 0
uploadvolumefactor: uploadvolumefactor:

View File

@@ -149,6 +149,8 @@ search:
filters: filters:
- name: regexp - name: regexp
args: "src=(.+?) " args: "src=(.+?) "
- name: replace
args: ["/pic/uploadimage.jpg", ""]
date: date:
selector: td:nth-last-child(1) selector: td:nth-last-child(1)
# auto adjusted by site account profile # auto adjusted by site account profile
@@ -167,7 +169,7 @@ search:
"*": 1 "*": 1
uploadvolumefactor: uploadvolumefactor:
text: 1 text: 1
genre_optional: genre:
# Drama, Romance | N/A | 2022 | 112 min | N/A # Drama, Romance | N/A | 2022 | 112 min | N/A
# Drama:Family:Romance # Drama:Family:Romance
selector: td:nth-child(2) selector: td:nth-child(2)
@@ -175,11 +177,10 @@ search:
filters: filters:
- name: split - name: split
args: ["|", 0] args: ["|", 0]
genre: - name: re_replace
# if its VIP then do not keep genre args: ["\\bn\\\\a\\b", ""]
text: "{{ if .Result._vip }}{{ else }}{{ .Result.genre_optional }}{{ end }}"
description: description:
text: "{{ if .Result._vip }}VIP ONLY{{ else }}{{ .Result.genre }}{{ end }}" text: "{{ .Result.genre }}{{ if .Result._vip }}</br>VIP ONLY{{ else }}{{ end }}"
minimumratio: minimumratio:
text: 1.0 text: 1.0
minimumseedtime: minimumseedtime:

View File

@@ -116,16 +116,15 @@ search:
args: ["/static/common/noartwork/noimage.png", ""] args: ["/static/common/noartwork/noimage.png", ""]
files: files:
selector: td:nth-child(3) selector: td:nth-child(3)
date_optional: date:
selector: td:nth-child(5) > span selector: td:nth-child(5) > span
attribute: title attribute: title
# auto adjusted by site account profile # auto adjusted by site account profile
optional: true optional: true
default: "20 years ago" # some torrents have "Never" date
filters: filters:
- name: dateparse - name: dateparse
args: "MMM dd yyyy, HH:mm" args: "MMM dd yyyy, HH:mm"
date: # some torrents have "Never" date
text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}20 years ago{{ end }}"
size: size:
selector: td:nth-child(6) selector: td:nth-child(6)
grabs: grabs:

View File

@@ -42,14 +42,13 @@ search:
download: download:
selector: a selector: a
attribute: href attribute: href
date_optional: date:
optional: true
selector: td.date selector: td.date
optional: true
default: now
filters: filters:
- name: dateparse - name: dateparse
args: "yyyy-MM-dd HH:mm" args: "yyyy-MM-dd HH:mm"
date:
text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}now{{ end }}"
size: size:
selector: td.bytes selector: td.bytes
optional: true optional: true

View File

@@ -229,18 +229,17 @@ search:
selector: span.leech selector: span.leech
grabs: grabs:
selector: span.complet selector: span.complet
date_optional: date:
# (09.03.2020) # (09.03.2020)
selector: a.topictitle selector: a.topictitle
optional: true optional: true
default: now
# do not append TZ else text {{if}} will not work if date not found # do not append TZ else text {{if}} will not work if date not found
filters: filters:
- name: regexp - name: regexp
args: (\d{2}\.\d{2}\.\d{4}) args: (\d{2}\.\d{2}\.\d{4})
- name: dateparse - name: dateparse
args: "dd.MM.yyyy" args: "dd.MM.yyyy"
date:
text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}now{{ end }}"
downloadvolumefactor: downloadvolumefactor:
text: 0 text: 0
uploadvolumefactor: uploadvolumefactor:

View File

@@ -183,16 +183,9 @@ search:
details: details:
selector: a[href^="details.php?name="] selector: a[href^="details.php?name="]
attribute: href attribute: href
poster_default: poster:
selector: img[class="lozad"] selector: img[class="lozad"]
attribute: data-src attribute: data-src
optional: true
poster_optional:
selector: img[src="//cdn.sktorrent.eu/obrazky/xXx.jpg"]
attribute: src
optional: true
poster:
text: "{{ if .Result.poster_optional }}{{ .Result.poster_optional }}{{ else }}{{ .Result.poster_default }}{{ end }}"
download: download:
selector: a[href^="details.php?name="] selector: a[href^="details.php?name="]
attribute: href attribute: href

View File

@@ -154,14 +154,13 @@ search:
attribute: href attribute: href
download_default: download_default:
selector: a[href^="download.php?torrent="] selector: a[href^="download.php?torrent="]
optional: true
attribute: href attribute: href
download_ssl:
selector: a[href^="download_ssl.php?torrent="]
optional: true optional: true
attribute: href
download: download:
text: "{{ if .Result.download_ssl }}{{ .Result.download_ssl }}{{ else }}{{ .Result.download_default }}{{ end }}" selector: a[href^="download_ssl.php?torrent="]
attribute: href
optional: true
default: "{{ .Result.download_default }}"
poster: poster:
selector: div[id^="details"] img selector: div[id^="details"] img
attribute: src attribute: src

View File

@@ -170,14 +170,13 @@ search:
download: download:
selector: td:nth-child(1) a selector: td:nth-child(1) a
attribute: href attribute: href
date_optional: date:
optional: true
selector: td:nth-child(2):contains("/") selector: td:nth-child(2):contains("/")
optional: true
default: now
filters: filters:
- name: dateparse - name: dateparse
args: "dd/MM/yyyy" args: "dd/MM/yyyy"
date:
text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}now{{ end }}"
size: size:
selector: "{{ if .Keywords }}td:nth-child(3){{ else }}td:nth-child(2){{ end }}" selector: "{{ if .Keywords }}td:nth-child(3){{ else }}td:nth-child(2){{ end }}"
filters: filters:

View File

@@ -105,14 +105,14 @@ search:
filters: filters:
- name: regexp - name: regexp
args: "Size: (.+?)<" args: "Size: (.+?)<"
files_optional: files:
selector: a[href^="/download.php?id="] selector: a[href^="/download.php?id="]
attribute: title attribute: title
optional: true
default: 1
filters: filters:
- name: regexp - name: regexp
args: "\\((\\d+) files\\)" args: "\\((\\d+) files\\)"
files:
text: "{{ if .Result.files_optional }}{{ .Result.files_optional }}{{ else }}1{{ end }}"
seeders: seeders:
selector: a[href^="/download.php?id="] selector: a[href^="/download.php?id="]
attribute: title attribute: title