diff --git a/docs/supportedsites.md b/docs/supportedsites.md index 481024eb..afb3a36d 100644 --- a/docs/supportedsites.md +++ b/docs/supportedsites.md @@ -346,7 +346,7 @@ Consider all listed sites to potentially be NSFW. FikFap https://fikfap.com/ - Posts, User Profiles + Hashtags, Posts, User Profiles diff --git a/gallery_dl/extractor/fikfap.py b/gallery_dl/extractor/fikfap.py index 64ba2f32..6ab7e52a 100644 --- a/gallery_dl/extractor/fikfap.py +++ b/gallery_dl/extractor/fikfap.py @@ -103,3 +103,25 @@ class FikfapUserExtractor(FikfapExtractor): if len(data) < 21: return params["afterId"] = data[-1]["postId"] + + +class FikfapHashtagExtractor(FikfapExtractor): + subcategory = "hashtag" + directory_fmt = ("{category}", "{hashtag}") + pattern = BASE_PATTERN + r"/hash/([\w-]+)" + example = "https://fikfap.com/hash/HASH" + + def posts(self): + self.kwdict["hashtag"] = hashtag = self.groups[0] + + url = f"{self.root_api}/hashtags/label/{hashtag}/posts" + params = {"amount": "21"} + + while True: + data = self.request_api(url, params) + + yield from data + + if len(data) < 21: + return + params["afterId"] = data[-1]["postId"] diff --git a/test/results/fikfap.py b/test/results/fikfap.py index a99c8639..4e82c015 100644 --- a/test/results/fikfap.py +++ b/test/results/fikfap.py @@ -18,7 +18,7 @@ __tests__ = ( "commentsCount" : int, "createdAt" : "2025-10-21T00:49:00.306Z", "date" : "dt:2025-10-21 00:49:00", - "date_updated" : "dt:2025-12-10 01:09:26", + "date_updated" : "dt:2026-02-07 01:07:45", "deletedAt" : None, "duration" : None, "explicitnessRating": None, @@ -27,15 +27,15 @@ __tests__ = ( "inCollectionsCount": range(20, 50), "isBunnyVideoReady": True, "label" : "⬇️check my FREE VIP OF ⬇️", - "likesCount" : range(500, 2000), + "likesCount" : range(300, 2000), "mediaId" : "b821619e-96a1-49a3-a3f8-a8a3e8432a51", "postId" : 1429486, "publishedAt" : "2025-10-21T00:50:37.143Z", - "score" : range(500, 2000), + "score" : range(300, 2000), "sexualOrientation": "STRAIGHT", "tags" : ["lesbian"], "thumbnailStreamUrl": str, - "updatedAt" : "2025-12-10T01:09:26.902Z", + "updatedAt" : "iso:dt", "uploadMethod" : "USER_FILE", "userId" : "32f4c8d6-2409-4db8-9e66-d3b5ff0c1a98", "videoStreamUrl" : str, @@ -49,7 +49,7 @@ __tests__ = ( "labelLower" : "lesbian", "lastCountUpdatedAt": "iso:dt", "searchTags" : [], - "thumbnailPostId": 301300, + "thumbnailPostId": 311180, "updatedAt" : "iso:dt", "sexualOrientations": [ "STRAIGHT", @@ -125,4 +125,14 @@ __tests__ = ( "#class" : fikfap.FikfapUserExtractor, }, +{ + "#url" : "https://fikfap.com/hash/outercourse", + "#class" : fikfap.FikfapHashtagExtractor, + "#pattern" : r"ytdl:https://[^/]+\.b\-cdn\.net/bcdn_token=.+/playlist\.m3u8$", + "#count" : range(50, 100), + + "algorithm": "hashtag-posts", + "hashtag" : "outercourse", +}, + )