Skip to content

Commit a8636e7

Browse files
[fikfap] add 'hashtag' extractor (#9018)
Added functionality to extract by hashtag and save to directory named after the hashtag.
1 parent 5d9b607 commit a8636e7

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

docs/supportedsites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ Consider all listed sites to potentially be NSFW.
346346
<tr id="fikfap" title="fikfap">
347347
<td>FikFap</td>
348348
<td>https://fikfap.com/</td>
349-
<td>Posts, User Profiles</td>
349+
<td>Hashtags, Posts, User Profiles</td>
350350
<td></td>
351351
</tr>
352352
<tr id="fitnakedgirls" title="fitnakedgirls">

gallery_dl/extractor/fikfap.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,25 @@ def posts(self):
103103
if len(data) < 21:
104104
return
105105
params["afterId"] = data[-1]["postId"]
106+
107+
108+
class FikfapHashtagExtractor(FikfapExtractor):
109+
subcategory = "hashtag"
110+
directory_fmt = ("{category}", "{hashtag}")
111+
pattern = BASE_PATTERN + r"/hash/([\w-]+)"
112+
example = "https://fikfap.com/hash/HASH"
113+
114+
def posts(self):
115+
self.kwdict["hashtag"] = hashtag = self.groups[0]
116+
117+
url = f"{self.root_api}/hashtags/label/{hashtag}/posts"
118+
params = {"amount": "21"}
119+
120+
while True:
121+
data = self.request_api(url, params)
122+
123+
yield from data
124+
125+
if len(data) < 21:
126+
return
127+
params["afterId"] = data[-1]["postId"]

test/results/fikfap.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"commentsCount" : int,
1919
"createdAt" : "2025-10-21T00:49:00.306Z",
2020
"date" : "dt:2025-10-21 00:49:00",
21-
"date_updated" : "dt:2025-12-10 01:09:26",
21+
"date_updated" : "dt:2026-02-07 01:07:45",
2222
"deletedAt" : None,
2323
"duration" : None,
2424
"explicitnessRating": None,
@@ -27,15 +27,15 @@
2727
"inCollectionsCount": range(20, 50),
2828
"isBunnyVideoReady": True,
2929
"label" : "⬇️check my FREE VIP OF ⬇️",
30-
"likesCount" : range(500, 2000),
30+
"likesCount" : range(300, 2000),
3131
"mediaId" : "b821619e-96a1-49a3-a3f8-a8a3e8432a51",
3232
"postId" : 1429486,
3333
"publishedAt" : "2025-10-21T00:50:37.143Z",
34-
"score" : range(500, 2000),
34+
"score" : range(300, 2000),
3535
"sexualOrientation": "STRAIGHT",
3636
"tags" : ["lesbian"],
3737
"thumbnailStreamUrl": str,
38-
"updatedAt" : "2025-12-10T01:09:26.902Z",
38+
"updatedAt" : "iso:dt",
3939
"uploadMethod" : "USER_FILE",
4040
"userId" : "32f4c8d6-2409-4db8-9e66-d3b5ff0c1a98",
4141
"videoStreamUrl" : str,
@@ -49,7 +49,7 @@
4949
"labelLower" : "lesbian",
5050
"lastCountUpdatedAt": "iso:dt",
5151
"searchTags" : [],
52-
"thumbnailPostId": 301300,
52+
"thumbnailPostId": 311180,
5353
"updatedAt" : "iso:dt",
5454
"sexualOrientations": [
5555
"STRAIGHT",
@@ -125,4 +125,14 @@
125125
"#class" : fikfap.FikfapUserExtractor,
126126
},
127127

128+
{
129+
"#url" : "https://fikfap.com/hash/outercourse",
130+
"#class" : fikfap.FikfapHashtagExtractor,
131+
"#pattern" : r"ytdl:https://[^/]+\.b\-cdn\.net/bcdn_token=.+/playlist\.m3u8$",
132+
"#count" : range(50, 100),
133+
134+
"algorithm": "hashtag-posts",
135+
"hashtag" : "outercourse",
136+
},
137+
128138
)

0 commit comments

Comments
 (0)