diff options
| author | 2026-01-06 04:24:52 -0500 | |
|---|---|---|
| committer | 2026-01-06 04:24:52 -0500 | |
| commit | 385e4bfb1e426d23417ac788a6f44d639e226c89 (patch) | |
| tree | e64f04e19d63014d48e3b5272ce112c637236ba7 /gallery_dl/extractor/flickr.py | |
| parent | a24ec1647aeac35a63b744ea856011ad6e06be3b (diff) | |
New upstream version 1.31.2.upstream/1.31.2upstream
Diffstat (limited to 'gallery_dl/extractor/flickr.py')
| -rw-r--r-- | gallery_dl/extractor/flickr.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gallery_dl/extractor/flickr.py b/gallery_dl/extractor/flickr.py index 1446eb8..5071de7 100644 --- a/gallery_dl/extractor/flickr.py +++ b/gallery_dl/extractor/flickr.py @@ -124,7 +124,7 @@ class FlickrAlbumExtractor(FlickrExtractor): directory_fmt = ("{category}", "{user[username]}", "Albums", "{album[id]} {album[title]}") archive_fmt = "a_{album[id]}_{id}" - pattern = rf"{BASE_PATTERN}/photos/([^/?#]+)/(?:album|set)s(?:/(\d+))?" + pattern = BASE_PATTERN + r"/photos/([^/?#]+)/(?:album|set)s(?:/(\d+))?" example = "https://www.flickr.com/photos/USER/albums/12345" def items(self): @@ -166,7 +166,7 @@ class FlickrGalleryExtractor(FlickrExtractor): directory_fmt = ("{category}", "{user[username]}", "Galleries", "{gallery[gallery_id]} {gallery[title]}") archive_fmt = "g_{gallery[id]}_{id}" - pattern = rf"{BASE_PATTERN}/photos/([^/?#]+)/galleries/(\d+)" + pattern = BASE_PATTERN + r"/photos/([^/?#]+)/galleries/(\d+)" example = "https://www.flickr.com/photos/USER/galleries/12345/" def metadata(self): @@ -184,7 +184,7 @@ class FlickrGroupExtractor(FlickrExtractor): subcategory = "group" directory_fmt = ("{category}", "Groups", "{group[groupname]}") archive_fmt = "G_{group[nsid]}_{id}" - pattern = rf"{BASE_PATTERN}/groups/([^/?#]+)" + pattern = BASE_PATTERN + r"/groups/([^/?#]+)" example = "https://www.flickr.com/groups/NAME/" def metadata(self): @@ -199,7 +199,7 @@ class FlickrUserExtractor(FlickrExtractor): """Extractor for the photostream of a flickr user""" subcategory = "user" archive_fmt = "u_{user[nsid]}_{id}" - pattern = rf"{BASE_PATTERN}/photos/([^/?#]+)/?$" + pattern = BASE_PATTERN + r"/photos/([^/?#]+)/?$" example = "https://www.flickr.com/photos/USER/" def photos(self): @@ -211,7 +211,7 @@ class FlickrFavoriteExtractor(FlickrExtractor): subcategory = "favorite" directory_fmt = ("{category}", "{user[username]}", "Favorites") archive_fmt = "f_{user[nsid]}_{id}" - pattern = rf"{BASE_PATTERN}/photos/([^/?#]+)/favorites" + pattern = BASE_PATTERN + r"/photos/([^/?#]+)/favorites" example = "https://www.flickr.com/photos/USER/favorites" def photos(self): @@ -223,7 +223,7 @@ class FlickrSearchExtractor(FlickrExtractor): subcategory = "search" directory_fmt = ("{category}", "Search", "{search[text]}") archive_fmt = "s_{search}_{id}" - pattern = rf"{BASE_PATTERN}/search/?\?([^#]+)" + pattern = BASE_PATTERN + r"/search/?\?([^#]+)" example = "https://flickr.com/search/?text=QUERY" def metadata(self): @@ -456,7 +456,7 @@ class FlickrAPI(oauth.OAuth1API): except ValueError: data = {"code": -1, "message": response.content} if "code" in data: - msg = data.get("message") + msg = data.get("message", "") self.log.debug("Server response: %s", data) if data["code"] == 1: raise exception.NotFoundError(self.extractor.subcategory) @@ -466,7 +466,7 @@ class FlickrAPI(oauth.OAuth1API): raise exception.AuthenticationError(msg) elif data["code"] == 99: raise exception.AuthorizationError(msg) - raise exception.AbortExtraction(f"API request failed: {msg}") + raise exception.AbortExtraction("API request failed: " + msg) return data def _pagination(self, method, params, key="photos"): |
