[unsplash] replace dash with space in search API queries (#2429)
This commit is contained in:
@@ -193,7 +193,7 @@ class UnsplashSearchExtractor(UnsplashExtractor):
|
||||
"""Extractor for unsplash search results"""
|
||||
subcategory = "search"
|
||||
pattern = BASE_PATTERN + r"/s/photos/([^/?#]+)(?:\?([^/?#]+))?"
|
||||
test = ("https://unsplash.com/s/photos/nature", {
|
||||
test = ("https://unsplash.com/s/photos/hair-style", {
|
||||
"pattern": r"https://images\.unsplash\.com/((flagged/)?photo-\d+-\w+"
|
||||
r"|reserve/[^/?#]+)\?ixid=\w+&ixlib=rb-1\.2\.1$",
|
||||
"range": "1-30",
|
||||
@@ -206,7 +206,7 @@ class UnsplashSearchExtractor(UnsplashExtractor):
|
||||
|
||||
def photos(self):
|
||||
url = self.root + "/napi/search/photos"
|
||||
params = {"query": text.unquote(self.item)}
|
||||
params = {"query": text.unquote(self.item.replace('-', ' '))}
|
||||
if self.query:
|
||||
params.update(text.parse_query(self.query))
|
||||
return self._pagination(url, params, True)
|
||||
|
||||
Reference in New Issue
Block a user