[nijie] fix image URL for single image posts (#5049)

This commit is contained in:
Mike Fährmann
2024-01-10 23:27:10 +01:00
parent bbf96753e2
commit 2191e29e14
2 changed files with 10 additions and 1 deletions

View File

@@ -116,7 +116,8 @@ class NijieExtractor(AsynchronousMixin, BaseExtractor):
yield from text.extract_iter( yield from text.extract_iter(
page, 'href="javascript:void(0);"><img src="', '"') page, 'href="javascript:void(0);"><img src="', '"')
else: else:
yield text.extr(page, 'itemprop="image" src="', '"') pos = page.find('id="view-center"') + 1
yield text.extract(page, 'itemprop="image" src="', '"', pos)[0]
@staticmethod @staticmethod
def _extract_user_name(page): def _extract_user_name(page):

View File

@@ -157,6 +157,14 @@ __tests__ = (
"user_name" : "黒川 竜", "user_name" : "黒川 竜",
}, },
{
"#url" : "https://nijie.info/view.php?id=37078",
"#comment" : "'view_side_dojin' thumbnails (#5049)",
"#category": ("Nijie", "nijie", "image"),
"#class" : nijie.NijieImageExtractor,
"#urls" : "https://pic.nijie.net/03/nijie/13/98/498/illust/0_0_703023d18ca8d058_bca943.jpg",
},
{ {
"#url" : "https://nijie.info/view.php?id=70724", "#url" : "https://nijie.info/view.php?id=70724",
"#category": ("Nijie", "nijie", "image"), "#category": ("Nijie", "nijie", "image"),