[pixiv] support short novel URLs

https://www.pixiv.net/n/<ID>
This commit is contained in:
Mike Fährmann
2023-05-21 14:26:30 +02:00
parent e6f55d1555
commit 56b8b8cd36

View File

@@ -756,8 +756,9 @@ class PixivNovelExtractor(PixivExtractor):
subcategory = "novel" subcategory = "novel"
request_interval = 1.0 request_interval = 1.0
pattern = (r"(?:https?://)?(?:www\.|touch\.)?pixiv\.net" pattern = (r"(?:https?://)?(?:www\.|touch\.)?pixiv\.net"
r"/novel/show\.php\?id=(\d+)") r"/n(?:ovel/show\.php\?id=|/)(\d+)")
test = ("https://www.pixiv.net/novel/show.php?id=19612040", { test = (
("https://www.pixiv.net/novel/show.php?id=19612040", {
"count": 1, "count": 1,
"content": "c6f22167f9df7aeaf63b51933b4c8ef6fc5e6a1e", "content": "c6f22167f9df7aeaf63b51933b4c8ef6fc5e6a1e",
"keyword": { "keyword": {
@@ -791,7 +792,9 @@ class PixivNovelExtractor(PixivExtractor):
"visible": True, "visible": True,
"x_restrict": 0, "x_restrict": 0,
}, },
}) }),
("https://www.pixiv.net/n/19612040"),
)
def __init__(self, match): def __init__(self, match):
PixivExtractor.__init__(self, match) PixivExtractor.__init__(self, match)