diff --git a/src/auto_archiver/archivers/generic_archiver/bluesky.py b/src/auto_archiver/archivers/generic_archiver/bluesky.py index 821d777..7aa9c39 100644 --- a/src/auto_archiver/archivers/generic_archiver/bluesky.py +++ b/src/auto_archiver/archivers/generic_archiver/bluesky.py @@ -27,8 +27,20 @@ class Bluesky(GenericDropin): return result def extract_post(self, url: str, ie_instance: InfoExtractor) -> dict: + # TODO: If/when this PR (https://github.com/yt-dlp/yt-dlp/pull/12098) is merged on ytdlp, remove the comments and delete the code below + # handle, video_id = ie_instance._match_valid_url(url).group('handle', 'id') + # return ie_instance._extract_post(handle=handle, post_id=video_id) + handle, video_id = ie_instance._match_valid_url(url).group('handle', 'id') - return ie_instance._extract_post(handle=handle, post_id=video_id) + return ie_instance._download_json( + 'https://public.api.bsky.app/xrpc/app.bsky.feed.getPostThread', + video_id, query={ + 'uri': f'at://{handle}/app.bsky.feed.post/{video_id}', + 'depth': 0, + 'parentHeight': 0, + })['thread']['post'] + + def _download_bsky_embeds(self, post: dict, archiver: Archiver) -> list[Media]: """