[zerochan] fix "KeyError: 'author'" (#7282)
fixes regression introduced in d746e025a0
This commit is contained in:
@@ -74,7 +74,6 @@ class ZerochanExtractor(BooruExtractor):
|
||||
extr = text.extract_from(page)
|
||||
data = {
|
||||
"id" : text.parse_int(entry_id),
|
||||
"author" : jsonld["author"]["name"],
|
||||
"file_url": jsonld["contentUrl"],
|
||||
"date" : text.parse_datetime(jsonld["datePublished"]),
|
||||
"width" : text.parse_int(jsonld["width"][:-3]),
|
||||
@@ -88,6 +87,11 @@ class ZerochanExtractor(BooruExtractor):
|
||||
'id="source-url"', '</p>').rpartition("</s>")[2])),
|
||||
}
|
||||
|
||||
try:
|
||||
data["author"] = jsonld["author"]["name"]
|
||||
except Exception:
|
||||
data["author"] = ""
|
||||
|
||||
html = data["tags"]
|
||||
tags = data["tags"] = []
|
||||
for tag in html.split("<li class=")[1:]:
|
||||
|
||||
Reference in New Issue
Block a user