From f47c0982a05ef2f4e600623549a4cbdcf2a9613b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 20 Nov 2024 16:05:05 +0100 Subject: [PATCH] [bluesky] improve 'web' did handling --- gallery_dl/extractor/bluesky.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/bluesky.py b/gallery_dl/extractor/bluesky.py index 18a50473..bbff17c9 100644 --- a/gallery_dl/extractor/bluesky.py +++ b/gallery_dl/extractor/bluesky.py @@ -64,7 +64,7 @@ class BlueskyExtractor(Extractor): did = post["author"]["did"] base = ( "{}/xrpc/com.atproto.sync.getBlob?did={}&cid=".format( - self.api.get_service_endpoint(did), did)) + self.api.service_endpoint(did), did)) for post["num"], file in enumerate(files, 1): post.update(file) yield Message.Url, base + file["filename"], post @@ -432,10 +432,9 @@ class BlueskyAPI(): return self._call(endpoint, params)["did"] @memcache(keyarg=1) - def get_service_endpoint(self, did): + def service_endpoint(self, did): if did.startswith('did:web:'): - url = "https://{}/.well-known/did.json".format( - did.rpartition(":")[2]) + url = "https://" + did[8:] + "/.well-known/did.json" else: url = "https://plc.directory/" + did