Link to parent, version bump, add iichan

This commit is contained in:
2019-09-14 11:10:09 -04:00
parent 8ef56871a9
commit 828a14ee98
14 changed files with 156 additions and 24 deletions

View File

@@ -57,19 +57,21 @@ class DesuChanHtmlChanHelper(ChanHelper):
op_el = soup.find("div", id=lambda tid: tid and tid[1:].isdigit())
tid = int(op_el.get("id")[1:])
for post_el in op_el.find_all("table", recursive=False):
*_, time = post_el.find("label").children
yield {
"id": int(post_el.find("td", attrs={"class", "reply"}).get("id")[5:]),
"type": "post",
"html": str(post_el),
"time": int(datetime.datetime.strptime(time, "\n%y/%m/%d(%a)%H:%M").timestamp())
"time": int(datetime.datetime.strptime(time, "\n%y/%m/%d(%a)%H:%M").timestamp()),
"parent": tid
}
post_el.decompose()
*_, time = op_el.find("label").children
yield {
"id": int(op_el.get("id")[1:]),
"id": tid,
"type": "thread",
"html": str(op_el),
"time": int(datetime.datetime.strptime(time, "\n%y/%m/%d(%a)%H:%M").timestamp())