[zerochan] fix 'source' extraction when not logged in
This commit is contained in:
@@ -78,8 +78,8 @@ class ZerochanExtractor(BooruExtractor):
|
||||
'class="breadcrumbs', '</nav>'))[2:],
|
||||
"uploader": extr('href="/user/', '"'),
|
||||
"tags" : extr('<ul id="tags"', '</ul>'),
|
||||
"source" : text.unescape(text.extr(
|
||||
extr('id="source-url"', '</a>'), 'href="', '"')),
|
||||
"source" : text.unescape(text.remove_html(extr(
|
||||
'id="source-url"', '</p>').rpartition("</s>")[2])),
|
||||
}
|
||||
|
||||
html = data["tags"]
|
||||
|
||||
@@ -134,7 +134,7 @@ __tests__ = (
|
||||
"DRAGON BALL",
|
||||
],
|
||||
"size" : 136192,
|
||||
"source": "https://x.com/Raydash30/status/1766012730769862774",
|
||||
"source" : "https://x.com/Raydash30/status/1766012730769862774",
|
||||
"tags" : [
|
||||
"Mangaka:Raydash",
|
||||
"Series:DRAGON BALL",
|
||||
@@ -177,6 +177,26 @@ __tests__ = (
|
||||
"width" : 750,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.zerochan.net/4233756",
|
||||
"#class" : zerochan.ZerochanImageExtractor,
|
||||
"#auth" : False,
|
||||
"#urls" : "https://static.zerochan.net/DRAGON.BALL.full.4233756.jpg",
|
||||
|
||||
"source" : "https://x.com/Raydash30/status/1766012730769862774",
|
||||
"tags" : [
|
||||
"Mangaka:Raydash",
|
||||
"Series:DRAGON BALL",
|
||||
"Series:DRAGON BALL Z",
|
||||
"Character:Piccolo",
|
||||
"Character:Son Gohan",
|
||||
"Theme:Green Skin",
|
||||
"Source:Fanart",
|
||||
"Source:Fanart from X (Twitter)",
|
||||
"Source:X (Twitter)",
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.zerochan.net/1395035",
|
||||
"#comment" : "Invalid control character '\r' in 'source' field (#5892)",
|
||||
|
||||
Reference in New Issue
Block a user