diff options
| author | 2024-03-25 02:57:50 -0400 | |
|---|---|---|
| committer | 2024-03-25 02:57:50 -0400 | |
| commit | 039aecad63a074bdcc75bd4f30c84bdc4a1a244f (patch) | |
| tree | 39997d0361f67208c716fba6717895b42ee309d1 /gallery_dl/extractor/flickr.py | |
| parent | 77d11300e15ee4045b187a58ee6e039624e5d69c (diff) | |
| parent | 6e662211019a89caec44de8a57c675872b0b5498 (diff) | |
Update upstream source from tag 'upstream/1.26.9'
Update to upstream version '1.26.9'
with Debian dir e04ff15132747292d335c9d456bd879aca333115
Diffstat (limited to 'gallery_dl/extractor/flickr.py')
| -rw-r--r-- | gallery_dl/extractor/flickr.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gallery_dl/extractor/flickr.py b/gallery_dl/extractor/flickr.py index f7dc3cc..c94a110 100644 --- a/gallery_dl/extractor/flickr.py +++ b/gallery_dl/extractor/flickr.py @@ -77,6 +77,8 @@ class FlickrImageExtractor(FlickrExtractor): photo = self.api.photos_getInfo(self.item_id) if self.api.exif: photo.update(self.api.photos_getExif(self.item_id)) + if self.api.contexts: + photo.update(self.api.photos_getAllContexts(self.item_id)) if photo["media"] == "video" and self.api.videos: self.api._extract_video(photo) @@ -268,6 +270,8 @@ class FlickrAPI(oauth.OAuth1API): self.exif = extractor.config("exif", False) self.videos = extractor.config("videos", True) + self.contexts = extractor.config("contexts", False) + self.maxsize = extractor.config("size-max") if isinstance(self.maxsize, str): for fmt, fmtname, fmtwidth in self.FORMATS: @@ -311,6 +315,13 @@ class FlickrAPI(oauth.OAuth1API): params = {"user_id": user_id} return self._pagination("people.getPhotos", params) + def photos_getAllContexts(self, photo_id): + """Returns all visible sets and pools the photo belongs to.""" + params = {"photo_id": photo_id} + data = self._call("photos.getAllContexts", params) + del data["stat"] + return data + def photos_getExif(self, photo_id): """Retrieves a list of EXIF/TIFF/GPS tags for a given photo.""" params = {"photo_id": photo_id} @@ -444,6 +455,8 @@ class FlickrAPI(oauth.OAuth1API): if self.exif: photo.update(self.photos_getExif(photo["id"])) + if self.contexts: + photo.update(self.photos_getAllContexts(photo["id"])) photo["id"] = text.parse_int(photo["id"]) if "owner" in photo: |
