Skip to content

Commit

Permalink
[bluesky] add 'instance' metadata field (#4438)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Mar 18, 2024
1 parent 718c870 commit da6ba60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gallery_dl/extractor/bluesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def _init(self):

self.api = BlueskyAPI(self)
self._user = self._user_did = None
self.instance = self.root.partition("://")[2]

def items(self):
for post in self.posts():
Expand Down Expand Up @@ -81,6 +82,7 @@ def items(self):
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(
Expand Down
3 changes: 2 additions & 1 deletion test/results/bluesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"filename" : "bafkreidypzoaybmfj5h7pnpiyct6ng5yae6ydp4czrm72ocg7ev6vbirri",
"height" : 630,
"indexedAt" : "2023-12-22T18:58:32.715Z",
"instance" : "bsky.app",
"labels" : [],
"likeCount" : int,
"num" : 1,
Expand All @@ -153,7 +154,7 @@
"followersCount": int,
"followsCount" : int,
"handle" : "bsky.app",
"indexedAt" : "2023-12-22T18:54:12.339Z",
"indexedAt" : "2024-01-20T05:04:41.904Z",
"labels" : [],
"postsCount" : int,
},
Expand Down

0 comments on commit da6ba60

Please sign in to comment.