-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[unsplash] update collections URL pattern (fixes #1627)
- Loading branch information
Showing
1 changed file
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,13 +172,16 @@ def photos(self): | |
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$", | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mikf
Author
Owner
|
||
"range": "1-30", | ||
"count": 30, | ||
}), | ||
("https://unsplash.com/collections/_8qJQ2bCMWE/2021.05"), | ||
) | ||
|
||
def photos(self): | ||
url = "{}/napi/collections/{}/photos".format(self.root, self.item) | ||
|
rb-1\.2\.1
Is that a good idea instead of
rb-[0-9]+(?:\.[0-9]+)*
?