Skip to content

Commit

Permalink
[zerochan] fix 'source' extraction when not logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Dec 12, 2024
1 parent 63008f7 commit d2c66ac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/zerochan.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def _parse_entry_html(self, entry_id):
'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"]
Expand Down
22 changes: 21 additions & 1 deletion test/results/zerochan.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"DRAGON BALL",
],
"size" : 136192,
"source": "https://x.com/Raydash30/status/1766012730769862774",
"source" : "https://x.com/Raydash30/status/1766012730769862774",
"tags" : [
"Mangaka:Raydash",
"Series:DRAGON BALL",
Expand Down Expand Up @@ -177,6 +177,26 @@
"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)",
Expand Down

0 comments on commit d2c66ac

Please sign in to comment.