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

This commit is contained in:
Mike Fährmann
2023-06-01 13:07:20 +02:00
parent bab13402df
commit 0cf7282fa0
2 changed files with 21 additions and 1 deletions

View File

@@ -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

View File

@@ -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):