[bluesky] add 'instance' metadata field (#4438)

pull/5349/head
Mike Fährmann 6 months ago
parent 718c870430
commit da6ba60331
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -40,6 +40,7 @@ class BlueskyExtractor(Extractor):
self.api = BlueskyAPI(self)
self._user = self._user_did = None
self.instance = self.root.partition("://")[2]
def items(self):
for post in self.posts():
@ -81,6 +82,7 @@ class BlueskyExtractor(Extractor):
if self._metadata_user:
post["user"] = self._user or post["author"]
post["instance"] = self.instance
post["post_id"] = pid
post["count"] = len(images)
post["date"] = text.parse_datetime(

@ -133,6 +133,7 @@ __tests__ = (
"filename" : "bafkreidypzoaybmfj5h7pnpiyct6ng5yae6ydp4czrm72ocg7ev6vbirri",
"height" : 630,
"indexedAt" : "2023-12-22T18:58:32.715Z",
"instance" : "bsky.app",
"labels" : [],
"likeCount" : int,
"num" : 1,
@ -153,7 +154,7 @@ __tests__ = (
"followersCount": int,
"followsCount" : int,
"handle" : "bsky.app",
"indexedAt" : "2023-12-22T18:54:12.339Z",
"indexedAt" : "2024-01-20T05:04:41.904Z",
"labels" : [],
"postsCount" : int,
},

Loading…
Cancel
Save