-
Notifications
You must be signed in to change notification settings - Fork 57
/
eh.crs
29 lines (27 loc) · 1.11 KB
/
eh.crs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Varibale
name = "test"
# Url parser
index(@page=0)="http://g.e-hentai.org/?page={@page}"
gallery(@page=0,code)="http://g.e-hentai.org/g/{code}/?p={@page}&hc=1"
# Crawler Struct
gallery[]: index -> $("table.itg tr.gtr0,tr.gtr1")
@next: $root("table.ptt td:last-child a").href
title: $("td.itd div div.it5 a").text
cover: $("td.itd div div.it2")
.html
.expand("(//|inits?~)(.*?org)[~/]([^~]*\\.jpg)[~\"]", "http://$2/$3")
uploader: $("td.itu div a").html
category: $("td.itdc a img").attr("alt")
datetime: $("td.itd[style]").html
rating: $("td.itd div div.it4 div")
.style
.expand(`background-position:-?(\d+)px -?(\d+)px`, "5-$1/16-($2-1)/40")
.calc
_code*: $("td.itd div div.it5 a").href.match("/g/(.*)")
tags[]: gallery(code = _code) -> $("div#taglist table tr td:eq(1) div a")
name*: .html
pictures[]: gallery(code = _code) -> $("div.gdtl,div.gdtm")
@next: $root("table.ptt td:last-child a").href
thumbnail: .html.match(`(https?://[^"]*?\.jpg)`)
_srcHref: $("a").href
src*: _srcHref -> $("div.sni a img[style]").src