From d8908ca5776a8e13af8eff5021e16bae13e5b701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 15 Jun 2021 15:42:04 +0200 Subject: [PATCH] [unsplash] update collections URL pattern (fixes #1627) --- gallery_dl/extractor/unsplash.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/gallery_dl/extractor/unsplash.py b/gallery_dl/extractor/unsplash.py index e89a5b77..6cfc69e4 100644 --- a/gallery_dl/extractor/unsplash.py +++ b/gallery_dl/extractor/unsplash.py @@ -172,13 +172,16 @@ class UnsplashFavoriteExtractor(UnsplashExtractor): class UnsplashCollectionExtractor(UnsplashExtractor): """Extractor for an unsplash collection""" subcategory = "collection" - pattern = BASE_PATTERN + r"/collections/(\d+)" - test = ("https://unsplash.com/collections/3178572/winter", { - "pattern": r"https://images\.unsplash\.com/(photo-\d+-\w+" - r"|reserve/[^/?#]+)\?ixid=\w+&ixlib=rb-1\.2\.1$", - "range": "1-30", - "count": 30, - }) + pattern = BASE_PATTERN + r"/collections/([^/?#]+)" + test = ( + ("https://unsplash.com/collections/3178572/winter", { + "pattern": r"https://images\.unsplash\.com/(photo-\d+-\w+" + r"|reserve/[^/?#]+)\?ixid=\w+&ixlib=rb-1\.2\.1$", + "range": "1-30", + "count": 30, + }), + ("https://unsplash.com/collections/_8qJQ2bCMWE/2021.05"), + ) def photos(self): url = "{}/napi/collections/{}/photos".format(self.root, self.item)