From a3dbc58172c41d9c1d6d208845352d780672d31f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Fri, 15 Nov 2024 08:27:52 +0100 Subject: [PATCH] [pillowfort] provide 'count' metadata field (#6478) --- gallery_dl/extractor/pillowfort.py | 1 + test/results/pillowfort.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/pillowfort.py b/gallery_dl/extractor/pillowfort.py index 5362f13e..5749240d 100644 --- a/gallery_dl/extractor/pillowfort.py +++ b/gallery_dl/extractor/pillowfort.py @@ -52,6 +52,7 @@ class PillowfortExtractor(Extractor): post["date"] = text.parse_datetime( post["created_at"], "%Y-%m-%dT%H:%M:%S.%f%z") post["post_id"] = post.pop("id") + post["count"] = len(files) yield Message.Directory, post post["num"] = 0 diff --git a/test/results/pillowfort.py b/test/results/pillowfort.py index 0d260b91..514697be 100644 --- a/test/results/pillowfort.py +++ b/test/results/pillowfort.py @@ -22,6 +22,7 @@ __tests__ = ( "comments_count" : int, "community_id" : None, "content" : str, + "count" : 4, "created_at" : str, "date" : datetime.datetime, "deleted" : None, @@ -36,7 +37,7 @@ __tests__ = ( "likes_count" : int, "media_type" : "picture", "nsfw" : False, - "num" : int, + "num" : range(1, 4), "original_post_id": None, "original_post_user_id": None, "picture_content_type": None, @@ -84,6 +85,7 @@ __tests__ = ( "community_id" : None, "concealed_comment_warning": None, "content" : "

Sea Bed

", + "count" : 1, "created_at" : r"re:2020-02-.+", "currentuser_default_avatar_url": None, "currentuser_multi_avi": None, @@ -177,7 +179,7 @@ __tests__ = ( "#category": ("", "pillowfort", "user"), "#class" : pillowfort.PillowfortUserExtractor, "#pattern" : r"https://img\d+\.pillowfort\.social/posts/", - "#count" : range(10, 20), + "#count" : range(30, 50), }, )