Patch in upstream changes to ytdlp for now

Seems like ytdlp may not merge https://github.com/yt-dlp/yt-dlp/pull/12098 anytime soon
pull/175/head
Patrick Robertson 2025-01-21 16:49:49 +01:00
rodzic 7c0dcbfd81
commit 9dde9b26d0
1 zmienionych plików z 13 dodań i 1 usunięć

Wyświetl plik

@ -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]:
"""