[bluesky] default to /posts if reposts/quoted is enabled (#6583)
This commit is contained in:
@@ -1455,7 +1455,10 @@ Type
|
|||||||
* ``string``
|
* ``string``
|
||||||
* ``list`` of ``strings``
|
* ``list`` of ``strings``
|
||||||
Default
|
Default
|
||||||
``"media"``
|
* ``"posts"`` if
|
||||||
|
`reposts <extractor.bluesky.reposts_>`__ or
|
||||||
|
`quoted <extractor.bluesky.quoted_>`__ is enabled
|
||||||
|
* ``"media"`` otherwise
|
||||||
Example
|
Example
|
||||||
* ``"avatar,background,posts"``
|
* ``"avatar,background,posts"``
|
||||||
* ``["avatar", "background", "posts"]``
|
* ``["avatar", "background", "posts"]``
|
||||||
@@ -1464,6 +1467,7 @@ Description
|
|||||||
when processing a user profile.
|
when processing a user profile.
|
||||||
|
|
||||||
Possible values are
|
Possible values are
|
||||||
|
``"info"``,
|
||||||
``"avatar"``,
|
``"avatar"``,
|
||||||
``"background"``,
|
``"background"``,
|
||||||
``"posts"``,
|
``"posts"``,
|
||||||
|
|||||||
@@ -204,6 +204,8 @@ class BlueskyUserExtractor(BlueskyExtractor):
|
|||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
base = "{}/profile/{}/".format(self.root, self.user)
|
base = "{}/profile/{}/".format(self.root, self.user)
|
||||||
|
default = ("posts" if self.config("quoted", False) or
|
||||||
|
self.config("reposts", False) else "media")
|
||||||
return self._dispatch_extractors((
|
return self._dispatch_extractors((
|
||||||
(BlueskyInfoExtractor , base + "info"),
|
(BlueskyInfoExtractor , base + "info"),
|
||||||
(BlueskyAvatarExtractor , base + "avatar"),
|
(BlueskyAvatarExtractor , base + "avatar"),
|
||||||
@@ -212,7 +214,7 @@ class BlueskyUserExtractor(BlueskyExtractor):
|
|||||||
(BlueskyRepliesExtractor , base + "replies"),
|
(BlueskyRepliesExtractor , base + "replies"),
|
||||||
(BlueskyMediaExtractor , base + "media"),
|
(BlueskyMediaExtractor , base + "media"),
|
||||||
(BlueskyLikesExtractor , base + "likes"),
|
(BlueskyLikesExtractor , base + "likes"),
|
||||||
), ("media",))
|
), (default,))
|
||||||
|
|
||||||
|
|
||||||
class BlueskyPostsExtractor(BlueskyExtractor):
|
class BlueskyPostsExtractor(BlueskyExtractor):
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ __tests__ = (
|
|||||||
"#class" : bluesky.BlueskyUserExtractor,
|
"#class" : bluesky.BlueskyUserExtractor,
|
||||||
"#options" : {"include": "all"},
|
"#options" : {"include": "all"},
|
||||||
"#urls" : (
|
"#urls" : (
|
||||||
|
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/info",
|
||||||
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/avatar",
|
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/avatar",
|
||||||
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/banner",
|
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/banner",
|
||||||
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/posts",
|
"https://bsky.app/profile/did:plc:z72i7hdynmk6r22z27h6tvur/posts",
|
||||||
@@ -42,6 +43,13 @@ __tests__ = (
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://bsky.app/profile/bsky.app",
|
||||||
|
"#class" : bluesky.BlueskyUserExtractor,
|
||||||
|
"#options" : {"quoted": True},
|
||||||
|
"#urls" : "https://bsky.app/profile/bsky.app/posts",
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://bsky.app/profile/bsky.app/info",
|
"#url" : "https://bsky.app/profile/bsky.app/info",
|
||||||
"#class" : bluesky.BlueskyInfoExtractor,
|
"#class" : bluesky.BlueskyInfoExtractor,
|
||||||
@@ -357,7 +365,7 @@ __tests__ = (
|
|||||||
"author": {
|
"author": {
|
||||||
"createdAt": "2024-10-17T13:55:48.833Z",
|
"createdAt": "2024-10-17T13:55:48.833Z",
|
||||||
"did" : "did:plc:7x6rtuenkuvxq3zsvffp2ide",
|
"did" : "did:plc:7x6rtuenkuvxq3zsvffp2ide",
|
||||||
"handle" : "alt.bun.how",
|
"handle" : "cinny.bun.how",
|
||||||
"instance" : "bun.how",
|
"instance" : "bun.how",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user