[scrolller] add 'user' extractor (#8961)

This commit is contained in:
Mike Fährmann
2026-02-02 09:09:50 +01:00
parent f99c8f5ad9
commit 17e1d25784
5 changed files with 106 additions and 1 deletions

View File

@@ -988,7 +988,7 @@ Consider all listed sites to potentially be NSFW.
<tr id="scrolller" title="scrolller">
<td>Scrolller</td>
<td>https://scrolller.com/</td>
<td>Followed Subreddits, Posts, Subreddits</td>
<td>Followed Subreddits, Posts, Subreddits, Reddit Users</td>
<td>Supported</td>
</tr>
<tr id="senmanga" title="senmanga">

View File

@@ -170,6 +170,32 @@ class ScrolllerSubredditExtractor(ScrolllerExtractor):
"SubredditChildrenQuery", variables, subreddit["children"])
class ScrolllerUserExtractor(ScrolllerExtractor):
"""Extractor for media from a scrolller Reddit user"""
subcategory = "user"
directory_fmt = ("{category}", "User", "{posted_by}")
pattern = BASE_PATTERN + r"/reddit-user/([^/?#]+)(?:/?\?([^#]+))?"
example = "https://scrolller.com/reddit-user/USER"
def posts(self):
query = "UserPostsQuery"
variables = {
"username": text.unquote(self.groups[0]),
"iterator": None,
"limit" : 40,
"filter" : None,
"sortBy" : "RANDOM",
"isNsfw" : True,
}
posts = self._request_graphql(query, variables)["getUserPosts"]
if not posts.get("items"):
posts = None
variables["isNsfw"] = False
return self._pagination(query, variables, posts)
class ScrolllerFollowingExtractor(ScrolllerExtractor):
"""Extractor for followed scrolller subreddits"""
subcategory = "following"

View File

@@ -25,6 +25,39 @@ query SubredditPostQuery(
}
"""
UserPostsQuery = """\
query UserPostsQuery(
$username: String!
$iterator: String
$limit: Int!
$filter: GalleryFilter
$sortBy: GallerySortBy
$isNsfw: Boolean
) {
getUserPosts(
data: {
username: $username
iterator: $iterator
limit: $limit
filter: $filter
sortBy: $sortBy
isNsfw: $isNsfw
}
) {
iterator items {
__typename id url title posted_by reddit_posted_by subredditId
subredditTitle subredditUrl subredditIsFollowing redditPath isNsfw
hasAudio fullLengthSource gfycatSource redgifsSource ownerAvatar
username displayName favoriteCount isPaid tags commentsCount
commentsRepliesCount duration createdAt isFavorite
albumContent { mediaSources { url width height isOptimized } }
mediaSources { url width height isOptimized }
blurredMediaSources { url width height isOptimized type }
}
}
}
"""
SubredditQuery = """\
query SubredditQuery(
$url: String!

View File

@@ -414,6 +414,7 @@ SUBCATEGORY_MAP = {
"books": "Book Searches",
},
"scrolller": {
"user" : "Reddit Users",
"following": "Followed Subreddits",
},
"sexcom": {

View File

@@ -115,4 +115,49 @@ __tests__ = (
"#auth" : True,
},
{
"#url" : "https://scrolller.com/reddit-user/Jonttufromesbo",
"#class" : scrolller.ScrolllerUserExtractor,
"#pattern" : (
r"https://images\.scrolller\.com/\w+/cabin-in-northern-finland-93vjsuxmcz.jpg",
r"https://images\.scrolller\.com/\w+/northern-lights-in-northern-finland-6ibp3516z1.jpg",
),
"blurredMediaSources": [],
"commentsCount" : 0,
"commentsRepliesCount": 0,
"count" : 1,
"createdAt" : "iso:8601",
"displayName" : None,
"duration" : None,
"extension" : "jpg",
"favoriteCount" : 0,
"filename" : str,
"fullLengthSource": None,
"gfycatSource" : None,
"hasAudio" : False,
"width" : {1080, 2048},
"height" : {1350, 1638},
"id" : {10478722, 32426595},
"isFavorite" : False,
"isNsfw" : False,
"isOptimized" : False,
"isPaid" : False,
"num" : 0,
"ownerAvatar" : None,
"posted_by" : "Jonttufromesbo",
"redditPath" : r"re:/r/AmateurPhotography/comments/\w+/\w+/",
"reddit_posted_by": "Jonttufromesbo",
"redgifsSource" : None,
"subredditId" : 413,
"subredditIsFollowing": False,
"subredditTitle" : "AmateurPhotography",
"subredditUrl" : "/r/AmateurPhotography",
"tags" : None,
"title" : str,
"url" : "re:https://images.scrolller.com/.+",
"username" : "",
"mediaSources" : list
},
)