[fikfap] add 'hashtag' extractor (#9018)
Added functionality to extract by hashtag and save to directory named after the hashtag.
This commit is contained in:
@@ -346,7 +346,7 @@ Consider all listed sites to potentially be NSFW.
|
||||
<tr id="fikfap" title="fikfap">
|
||||
<td>FikFap</td>
|
||||
<td>https://fikfap.com/</td>
|
||||
<td>Posts, User Profiles</td>
|
||||
<td>Hashtags, Posts, User Profiles</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr id="fitnakedgirls" title="fitnakedgirls">
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user