[pixiv] add 'full-series' option for novels (#4111)

pull/4133/head
Mike Fährmann 1 year ago
parent bab13402df
commit 0cf7282fa0
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -2436,6 +2436,17 @@ Description
Download images embedded in novels.
extractor.pixiv.novel.full-series
---------------------------------
Type
``bool``
Default
``false``
Description
When downloading a novel being part of a series,
download all novels of that series.
extractor.pixiv.metadata
------------------------
Type

@ -796,6 +796,11 @@ class PixivNovelExtractor(PixivExtractor):
"options": (("embeds", True),),
"count": 3,
}),
# full series
("https://www.pixiv.net/novel/show.php?id=19612040", {
"options": (("full-series", True),),
"count": 4,
}),
# short URL
("https://www.pixiv.net/n/19612040"),
)
@ -893,7 +898,11 @@ class PixivNovelExtractor(PixivExtractor):
yield Message.Queue, url, novel
def novels(self):
return (self.api.novel_detail(self.novel_id),)
novel = self.api.novel_detail(self.novel_id)
if self.config("full-series") and novel["series"]:
self.subcategory = PixivNovelSeriesExtractor.subcategory
return self.api.novel_series(novel["series"]["id"])
return (novel,)
class PixivNovelUserExtractor(PixivNovelExtractor):

Loading…
Cancel
Save