[instagram] raise proper error for missing 'reels_media' (#5257)

This commit is contained in:
Mike Fährmann
2024-03-02 17:40:13 +01:00
parent 82c73c77b0
commit 218ec1a9ee

View File

@@ -689,7 +689,10 @@ class InstagramRestAPI():
def reels_media(self, reel_ids):
endpoint = "/v1/feed/reels_media/"
params = {"reel_ids": reel_ids}
return self._call(endpoint, params=params)["reels_media"]
try:
return self._call(endpoint, params=params)["reels_media"]
except KeyError:
raise exception.AuthorizationError("Login required")
def tags_media(self, tag):
for section in self.tags_sections(tag):