mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
parent
e17b1d5073
commit
2e11b6e756
@ -56,7 +56,7 @@ class NijieExtractor(AsynchronousMixin, BaseExtractor):
|
||||
data["user_id"] = data["artist_id"]
|
||||
data["user_name"] = data["artist_name"]
|
||||
|
||||
urls = list(self._extract_images(image_id, page))
|
||||
urls = self._extract_images(image_id, page)
|
||||
data["count"] = len(urls)
|
||||
|
||||
yield Message.Directory, data
|
||||
@ -113,11 +113,14 @@ class NijieExtractor(AsynchronousMixin, BaseExtractor):
|
||||
# multiple images
|
||||
url = "{}/view_popup.php?id={}".format(self.root, image_id)
|
||||
page = self.request(url).text
|
||||
yield from text.extract_iter(
|
||||
page, 'href="javascript:void(0);"><img src="', '"')
|
||||
return [
|
||||
text.extr(media, ' src="', '"')
|
||||
for media in text.extract_iter(
|
||||
page, 'href="javascript:void(0);"><', '>')
|
||||
]
|
||||
else:
|
||||
pos = page.find('id="view-center"') + 1
|
||||
yield text.extract(page, 'itemprop="image" src="', '"', pos)[0]
|
||||
return (text.extr(page, 'itemprop="image" src="', '"', pos),)
|
||||
|
||||
@staticmethod
|
||||
def _extract_user_name(page):
|
||||
|
@ -165,6 +165,18 @@ __tests__ = (
|
||||
"#urls" : "https://pic.nijie.net/03/nijie/13/98/498/illust/0_0_703023d18ca8d058_bca943.jpg",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://nijie.info/view.php?id=385585",
|
||||
"#comment" : "video (#5707)",
|
||||
"#category": ("Nijie", "nijie", "image"),
|
||||
"#class" : nijie.NijieImageExtractor,
|
||||
"#urls" : (
|
||||
"https://pic.nijie.net/01/nijie/20/82/59182/illust/0_0_162270ef49e2ee28_fab5ae.mp4",
|
||||
"https://pic.nijie.net/04/nijie/20/82/59182/illust/385585_0_ff2d5d19129530d5_b2821e.jpg",
|
||||
"https://pic.nijie.net/01/nijie/20/82/59182/illust/385585_1_7ee1a2a67bed2f84_212d67.jpg",
|
||||
),
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://nijie.info/view.php?id=70724",
|
||||
"#category": ("Nijie", "nijie", "image"),
|
||||
|
Loading…
Reference in New Issue
Block a user