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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -116,16 +116,15 @@ search:
args: ["/static/common/noartwork/noimage.png", ""]
files:
selector: td:nth-child(3)
date_optional:
date:
selector: td:nth-child(5) > span
attribute: title
# auto adjusted by site account profile
optional: true
default: "20 years ago" # some torrents have "Never" date
filters:
- name: dateparse
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:
selector: td:nth-child(6)
grabs:

View File

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

View File

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

View File

@@ -183,16 +183,9 @@ search:
details:
selector: a[href^="details.php?name="]
attribute: href
poster_default:
poster:
selector: img[class="lozad"]
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:
selector: a[href^="details.php?name="]
attribute: href

View File

@@ -154,14 +154,13 @@ search:
attribute: href
download_default:
selector: a[href^="download.php?torrent="]
optional: true
attribute: href
download_ssl:
selector: a[href^="download_ssl.php?torrent="]
optional: true
attribute: href
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:
selector: div[id^="details"] img
attribute: src

View File

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

View File

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