diff --git a/docs/configuration.rst b/docs/configuration.rst index aace7d75..4460383c 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1185,6 +1185,18 @@ Description Download embedded videos hosted on https://www.blogger.com/ +extractor.bluesky.post.depth +---------------------------- +Type + ``integer`` +Default + ``0`` +Description + Sets the maximum depth of returned reply posts. + + (See `depth` parameter of `app.bsky.feed.getPostThread `__) + + extractor.cyberdrop.domain -------------------------- Type diff --git a/gallery_dl/extractor/bluesky.py b/gallery_dl/extractor/bluesky.py index 77b75769..fdb171ae 100644 --- a/gallery_dl/extractor/bluesky.py +++ b/gallery_dl/extractor/bluesky.py @@ -206,9 +206,9 @@ class BlueskyAPI(): """ def __init__(self, extractor): - self.headers = {} self.extractor = extractor self.log = extractor.log + self.headers = {"Accept": "application/json"} self.username, self.password = extractor._get_auth_info() if self.username: @@ -265,8 +265,22 @@ class BlueskyAPI(): params = { "uri": "at://{}/app.bsky.feed.post/{}".format( self._did_from_actor(actor), post_id), + "depth" : self.extractor.config("depth", "0"), + "parentHeight": "0", } - return (self._call(endpoint, params)["thread"],) + + thread = self._call(endpoint, params)["thread"] + if "replies" not in thread: + return (thread,) + + index = 0 + posts = [thread] + while index < len(posts): + post = posts[index] + if "replies" in post: + posts.extend(post["replies"]) + index += 1 + return posts def get_profile(self, actor): endpoint = "app.bsky.actor.getProfile"