mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
parent
c8b591303f
commit
495c9ee126
@ -1242,6 +1242,16 @@ Description
|
||||
(See `depth` parameter of `app.bsky.feed.getPostThread <https://www.docs.bsky.app/docs/api/app-bsky-feed-get-post-thread>`__)
|
||||
|
||||
|
||||
extractor.bluesky.reposts
|
||||
-------------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``false``
|
||||
Description
|
||||
Process reposts.
|
||||
|
||||
|
||||
extractor.cyberdrop.domain
|
||||
--------------------------
|
||||
Type
|
||||
|
@ -39,12 +39,18 @@ class BlueskyExtractor(Extractor):
|
||||
self._metadata_facets = ("facets" in meta)
|
||||
|
||||
self.api = BlueskyAPI(self)
|
||||
self._user = None
|
||||
self._user = self._user_did = None
|
||||
|
||||
def items(self):
|
||||
for post in self.posts():
|
||||
if "post" in post:
|
||||
post = post["post"]
|
||||
|
||||
pid = post["uri"].rpartition("/")[2]
|
||||
if self._user_did and post["author"]["did"] != self._user_did:
|
||||
self.log.debug("Skipping %s (repost)", pid)
|
||||
continue
|
||||
|
||||
post.update(post["record"])
|
||||
del post["record"]
|
||||
|
||||
@ -75,7 +81,7 @@ class BlueskyExtractor(Extractor):
|
||||
if self._metadata_user:
|
||||
post["user"] = self._user or post["author"]
|
||||
|
||||
post["post_id"] = post["uri"].rpartition("/")[2]
|
||||
post["post_id"] = pid
|
||||
post["count"] = len(images)
|
||||
post["date"] = text.parse_datetime(
|
||||
post["createdAt"][:19], "%Y-%m-%dT%H:%M:%S")
|
||||
@ -385,8 +391,11 @@ class BlueskyAPI():
|
||||
else:
|
||||
did = self.resolve_handle(actor)
|
||||
|
||||
if self.extractor._metadata_user:
|
||||
self.extractor._user = self.get_profile(did)
|
||||
extr = self.extractor
|
||||
if not extr.config("reposts", False):
|
||||
extr._user_did = did
|
||||
if extr._metadata_user:
|
||||
extr._user = self.get_profile(did)
|
||||
|
||||
return did
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user