[pixiv] provide 'count' metadata (#8794)
This commit is contained in:
@@ -92,10 +92,11 @@ class PixivExtractor(Extractor):
|
||||
work["caption"] = self._sanitize_ajax_caption(
|
||||
body["illustComment"])
|
||||
|
||||
if transform_tags:
|
||||
if transform_tags is not None:
|
||||
transform_tags(work)
|
||||
work["num"] = 0
|
||||
work["date"] = dt.parse_iso(work["create_date"])
|
||||
work["count"] = len(files)
|
||||
work["rating"] = ratings.get(work["x_restrict"])
|
||||
work["suffix"] = ""
|
||||
work.update(metadata)
|
||||
|
||||
@@ -217,11 +217,12 @@ __tests__ = (
|
||||
|
||||
{
|
||||
"#url" : "https://www.pixiv.net/artworks/966412",
|
||||
"#comment" : "related works (#1237)",
|
||||
"#class" : pixiv.PixivWorkExtractor,
|
||||
"#sha1_url" : "90c1715b07b0d1aad300bce256a0bc71f42540ba",
|
||||
"#sha1_content": "69a8edfb717400d1c2e146ab2b30d2c235440c5a",
|
||||
|
||||
"count" : 1,
|
||||
"num" : 0,
|
||||
"date" : "dt:2008-06-12 15:29:13",
|
||||
"date_url": "dt:2008-06-12 15:29:13",
|
||||
},
|
||||
@@ -239,6 +240,7 @@ __tests__ = (
|
||||
"#results" : "https://i.pximg.net/img-zip-ugoira/img/2018/01/15/13/24/48/66806629_ugoira1920x1080.zip",
|
||||
|
||||
"frames" : list,
|
||||
"count" : 1,
|
||||
"date" : "dt:2018-01-14 15:06:08",
|
||||
"date_url": "dt:2018-01-15 04:24:48",
|
||||
},
|
||||
@@ -258,6 +260,7 @@ __tests__ = (
|
||||
),
|
||||
|
||||
"frames": list,
|
||||
"count" : 6,
|
||||
},
|
||||
|
||||
{
|
||||
@@ -287,6 +290,7 @@ __tests__ = (
|
||||
"caption" : "Meet a deer .",
|
||||
"comment_access_control": 0,
|
||||
"comments" : (),
|
||||
"count" : 1,
|
||||
"create_date" : "2022-11-19T15:00:00+00:00",
|
||||
"date" : "dt:2022-11-19 15:00:00",
|
||||
"date_url" : "dt:2022-11-19 15:00:49",
|
||||
@@ -368,10 +372,7 @@ __tests__ = (
|
||||
"#comment" : "deleted limit_sanity_level_360.png work (#6339)",
|
||||
"#class" : pixiv.PixivWorkExtractor,
|
||||
"#count" : 0,
|
||||
"#log" : (
|
||||
("warning", "104582860: 'limit_sanity_level' warning"),
|
||||
("error" , "'General Error'"),
|
||||
),
|
||||
"#exception": exception.NotFoundError,
|
||||
},
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user