1337x: optional category and conditional date parsing

This commit is contained in:
kaso17 2017-09-17 16:32:05 +02:00
parent 24fe395cf0
commit 61e2add89a
1 changed files with 27 additions and 16 deletions

View File

@ -111,6 +111,7 @@
title: title:
selector: td[class^="coll-1"] a[href^="/torrent/"] selector: td[class^="coll-1"] a[href^="/torrent/"]
category: category:
optional: true
selector: td[class^="coll-1"] a[href^="/sub/"] selector: td[class^="coll-1"] a[href^="/sub/"]
attribute: href attribute: href
filters: filters:
@ -128,18 +129,12 @@
# magnet URI is on the details page # magnet URI is on the details page
# selector: td[class^="coll-1"] a[href^="/torrent/"] # selector: td[class^="coll-1"] a[href^="/torrent/"]
# attribute: href # attribute: href
# dates come in three flavours:
date: date:
selector: td[class^="coll-date"] # (within this year) 7am Sep. 14th
optional: true
selector: td[class^="coll-date"]:not(:contains(":")):not(:contains("'"))
filters: filters:
# dates come in three flavours:
# (more than a year ago) Apr. 18th '11
# (within this year) 7am Sep. 14th
# (today) 12:25am
# this code will generate 2 silent errors for each row (visible in enhanced logs). is there a better way? Corrections welcome.
- name: replace
args: ["'", ""]
- name: replace
args: [".", ""]
- name: replace - name: replace
args: ["st", ""] args: ["st", ""]
- name: replace - name: replace
@ -148,16 +143,32 @@
args: ["rd", ""] args: ["rd", ""]
- name: replace - name: replace
args: ["th", ""] args: ["th", ""]
- name: dateparse
args: "3pm Jan. 2"
date:
# (more than a year ago) Apr. 18th '11
optional: true
selector: td[class^="coll-date"]:contains("'")
filters:
- name: replace - name: replace
args: ["am", ""] args: ["'", ""]
- name: replace - name: replace
args: ["pm", ""] args: ["st", ""]
- name: replace
args: ["nd", ""]
- name: replace
args: ["rd", ""]
- name: replace
args: ["th", ""]
- name: dateparse - name: dateparse
args: "MMM d y" args: "Jan. 2 06"
date:
# # (today) 12:25am
optional: true
selector: td[class^="coll-date"]:contains(":")
filters:
- name: dateparse - name: dateparse
args: "h MMM d" args: "3:04pm"
- name: dateparse
args: "h:mm"
size: size:
selector: td[class^="coll-4"] selector: td[class^="coll-4"]
seeders: seeders: