torrent-turk: added unix date support

This commit is contained in:
Garfield69
2021-11-01 09:50:05 +13:00
parent b3f4e41c72
commit cece6cf024

View File

@@ -156,29 +156,35 @@ search:
selector: a[href*="?p=torrents&pid=10&action=download"] selector: a[href*="?p=torrents&pid=10&action=download"]
attribute: href attribute: href
date_year: date_year:
optional: true
# Uploaded 30-01-2019 15:02 by # Uploaded 30-01-2019 15:02 by
selector: td.torrent_name:not(:contains(" at ")) selector: td.torrent_name:not(:contains(" at ")):not(:has(abbr[data-time]))
optional: true
filters: filters:
- name: regexp - name: regexp
args: "Uploaded (.+?) by" args: "Uploaded (.+?) by"
- name: append - name: append
args: " +03:00" # TRT args: " +00:00" # auto adjusted by site account profile
- name: dateparse - name: dateparse
args: "02-01-2006 15:04 -07:00" args: "02-01-2006 15:04 -07:00"
date_day: date_day:
optional: true
# Uploaded Friday at 05:11 by # Uploaded Friday at 05:11 by
# Uploaded Today at 00:48 by # Uploaded Today at 00:48 by
# Uploaded Yesterday at 23:57 by # Uploaded Yesterday at 23:57 by
selector: td.torrent_name:contains(" at ") selector: td.torrent_name:contains(" at "):not(:has(abbr[data-time]))
optional: true
filters: filters:
- name: regexp - name: regexp
args: "Uploaded (.+?) by" args: "Uploaded (.+?) by"
- name: replace - name: replace
args: [" at ", " "] args: [" at ", " "]
- name: fuzzytime
date_unix:
# within the hour (unix)
selector: abbr[data-time]
attribute: data-time
optional: true
date: date:
text: "{{ if or .Result.date_year .Result.date_day }}{{ or .Result.date_year .Result.date_day }}{{ else }}now{{ end }}" text: "{{ if or .Result.date_year .Result.date_unix .Result.date_day }}{{ or .Result.date_year .Result.date_unix .Result.date_day }}{{ else }}now{{ end }}"
size: size:
selector: a[rel="torrent_size"] selector: a[rel="torrent_size"]
seeders: seeders: