1
0
Fork 0
mirror of https://github.com/Findus23/acronomy.git synced 2024-09-19 15:33:45 +02:00

don't add images without attribution key

This commit is contained in:
Lukas Winkler 2020-07-28 19:23:30 +02:00
parent 30b1467077
commit 16145e1c9c
Signed by: lukas
GPG key ID: 54DE4D798D244853

View file

@ -65,7 +65,7 @@ class WikipediaImageAPIObject:
r.raise_for_status()
self.data = r.json()
self.image_obj = list(self.data["query"]["pages"].values())[0]
if "imageinfo" not in self.image_obj:
if "imageinfo" not in self.image_obj or "AttributionRequired" not in self.extmetadata:
raise NotFoundError()
@classmethod