Skip to content

Commit

Permalink
[poipiku] always query 'ShowAppendFileF' when post has warning (#6736)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Dec 27, 2024
1 parent bc7e956 commit 7391dd2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
10 changes: 7 additions & 3 deletions gallery_dl/extractor/poipiku.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,23 @@ def items(self):
}

yield Message.Directory, post
post["num"] = 0
post["num"] = warning = 0

while True:
thumb = extr('class="IllustItemThumbImg" src="', '"')
if not thumb:
break
elif thumb.startswith(("//img.poipiku.com/img/", "/img/")):
if "/warning" in thumb:
warning = True
self.log.debug("%s: %s", post["post_id"], thumb)
continue
post["num"] += 1
url = text.ensure_http_scheme(thumb[:-8]).replace(
"//img.", "//img-org.", 1)
yield Message.Url, url, text.nameext_from_url(url, post)

if not extr('ShowAppendFile', '<'):
if not warning and not extr('ShowAppendFile', '<'):
continue

url = self.root + "/f/ShowAppendFileF.jsp"
Expand All @@ -87,7 +90,8 @@ def items(self):

page = resp["html"]
if (resp.get("result_num") or 0) < 0:
self.log.warning("'%s'", page.replace("<br/>", " "))
self.log.warning("%s: '%s'",
post["post_id"], page.replace("<br/>", " "))

for thumb in text.extract_iter(
page, 'class="IllustItemThumbImg" src="', '"'):
Expand Down
20 changes: 18 additions & 2 deletions test/results/poipiku.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"#count" : 4,

"count" : 4,
"num" : range(1, 4),
"description" : "絵茶の産物ネタバレあるやつ",
"num" : int,
"post_category": "SPOILER",
"post_id" : "6411749",
"user_id" : "2166245",
Expand All @@ -65,12 +65,28 @@
"#count" : 3,

"count" : 3,
"num" : range(1, 3),
"description" : "ORANGE OASISボスネタバレ<br />曲も大好き<br />2枚目以降はほとんど見えなかった1枚目背景のヒエログリフ小ネタです𓀀",
"num" : int,
"post_category": "SPOILER",
"post_id" : "5776587",
"user_id" : "3572553",
"user_name" : "nagakun",
},

{
"#url" : "https://poipiku.com/1400760/5483268.html",
"#comment" : "Warning and no 'Show all' button (#6736)",
"#category": ("", "poipiku", "post"),
"#class" : poipiku.PoipikuPostExtractor,
"#urls" : "https://img-org.poipiku.com/user_img02/001400760/005483268_JdB7sAWpv.jpeg",

"count" : 1,
"num" : 1,
"description" : "えち描く描く詐欺ずっとやってるのですこしかいてた<br />ほたしか写ってないよ",
"post_category": "TRAINING",
"post_id" : "5483268",
"user_id" : "1400760",
"user_name" : "onitsuraaaai",
},

)

0 comments on commit 7391dd2

Please sign in to comment.