aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/unsplash.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2025-12-20 05:49:11 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2025-12-20 05:49:11 -0500
commitc586ea4b3c871f5696626f9820e8c88a4e78f4a6 (patch)
treee6d7bae96282c3d147159f091d451e53bdaa2efe /gallery_dl/extractor/unsplash.py
parent01a2bf622c31072d1322884584404b9bd59b28cc (diff)
parenta24ec1647aeac35a63b744ea856011ad6e06be3b (diff)
Update upstream source from tag 'upstream/1.31.1'
Update to upstream version '1.31.1' with Debian dir b5d91c25143175f933b1c69c7e82249cd7e145ab
Diffstat (limited to 'gallery_dl/extractor/unsplash.py')
-rw-r--r--gallery_dl/extractor/unsplash.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/gallery_dl/extractor/unsplash.py b/gallery_dl/extractor/unsplash.py
index cf6631f..b77be95 100644
--- a/gallery_dl/extractor/unsplash.py
+++ b/gallery_dl/extractor/unsplash.py
@@ -41,11 +41,11 @@ class UnsplashExtractor(Extractor):
if metadata:
photo.update(metadata)
photo["extension"] = "jpg"
- photo["date"] = text.parse_datetime(photo["created_at"])
+ photo["date"] = self.parse_datetime_iso(photo["created_at"])
if "tags" in photo:
photo["tags"] = [t["title"] for t in photo["tags"]]
- yield Message.Directory, photo
+ yield Message.Directory, "", photo
yield Message.Url, url, photo
def metadata(self):
@@ -74,7 +74,7 @@ class UnsplashExtractor(Extractor):
class UnsplashImageExtractor(UnsplashExtractor):
"""Extractor for a single unsplash photo"""
subcategory = "image"
- pattern = BASE_PATTERN + r"/photos/([^/?#]+)"
+ pattern = rf"{BASE_PATTERN}/photos/([^/?#]+)"
example = "https://unsplash.com/photos/ID"
def photos(self):
@@ -85,7 +85,7 @@ class UnsplashImageExtractor(UnsplashExtractor):
class UnsplashUserExtractor(UnsplashExtractor):
"""Extractor for all photos of an unsplash user"""
subcategory = "user"
- pattern = BASE_PATTERN + r"/@(\w+)/?$"
+ pattern = rf"{BASE_PATTERN}/@(\w+)/?$"
example = "https://unsplash.com/@USER"
def photos(self):
@@ -97,7 +97,7 @@ class UnsplashUserExtractor(UnsplashExtractor):
class UnsplashFavoriteExtractor(UnsplashExtractor):
"""Extractor for all likes of an unsplash user"""
subcategory = "favorite"
- pattern = BASE_PATTERN + r"/@(\w+)/likes"
+ pattern = rf"{BASE_PATTERN}/@(\w+)/likes"
example = "https://unsplash.com/@USER/likes"
def photos(self):
@@ -109,7 +109,7 @@ class UnsplashFavoriteExtractor(UnsplashExtractor):
class UnsplashCollectionExtractor(UnsplashExtractor):
"""Extractor for an unsplash collection"""
subcategory = "collection"
- pattern = BASE_PATTERN + r"/collections/([^/?#]+)(?:/([^/?#]+))?"
+ pattern = rf"{BASE_PATTERN}/collections/([^/?#]+)(?:/([^/?#]+))?"
example = "https://unsplash.com/collections/12345/TITLE"
def __init__(self, match):
@@ -128,7 +128,7 @@ class UnsplashCollectionExtractor(UnsplashExtractor):
class UnsplashSearchExtractor(UnsplashExtractor):
"""Extractor for unsplash search results"""
subcategory = "search"
- pattern = BASE_PATTERN + r"/s/photos/([^/?#]+)(?:\?([^#]+))?"
+ pattern = rf"{BASE_PATTERN}/s/photos/([^/?#]+)(?:\?([^#]+))?"
example = "https://unsplash.com/s/photos/QUERY"
def __init__(self, match):