Skip to content

Commit

Permalink
[artstation] fix searches (#2970)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 27, 2022
1 parent 2c67bee commit aafea0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gallery_dl/extractor/artstation.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,16 +298,16 @@ class ArtstationSearchExtractor(ArtstationExtractor):
archive_fmt = "s_{search[query]}_{asset[id]}"
pattern = (r"(?:https?://)?(?:\w+\.)?artstation\.com"
r"/search/?\?([^#]+)")
test = ("https://www.artstation.com/search?q=ancient&sort_by=rank", {
test = ("https://www.artstation.com/search?query=ancient&sort_by=rank", {
"range": "1-20",
"count": 20,
})

def __init__(self, match):
ArtstationExtractor.__init__(self, match)
query = text.parse_query(match.group(1))
self.query = query.get("q", "")
self.sorting = query.get("sort_by", "rank").lower()
self.query = text.unquote(query.get("query") or query.get("q", ""))
self.sorting = query.get("sort_by", "relevance").lower()

def metadata(self):
return {"search": {
Expand Down

0 comments on commit aafea0c

Please sign in to comment.