Skip to content

Commit

Permalink
[deviantart] update parameters for '/browse/popular'
Browse files Browse the repository at this point in the history
- limit results to 50 when also querying metadata (fixes #1267)
- remove deprecated 'category_path' parameter
  • Loading branch information
mikf committed Jan 26, 2021
1 parent c26de09 commit c6cc86d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions gallery_dl/extractor/deviantart.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ def __init__(self, match):

def deviations(self):
return self.api.browse_popular(
self.search_term, self.time_range, self.category_path, self.offset)
self.search_term, self.time_range, self.offset)

def prepare(self, deviation):
DeviantartExtractor.prepare(self, deviation)
Expand Down Expand Up @@ -918,13 +918,16 @@ def __init__(self, extractor):
self.client_id,
)

def browse_popular(self, query=None, timerange=None,
category_path=None, offset=0):
def browse_popular(self, query=None, timerange=None, offset=0):
"""Yield popular deviations"""
endpoint = "browse/popular"
params = {"q": query, "offset": offset, "limit": 120,
"timerange": timerange, "category_path": category_path,
"mature_content": self.mature}
params = {
"q" : query,
"limit" : 50 if self.metadata else 120,
"timerange" : timerange,
"offset" : offset,
"mature_content": self.mature,
}
return self._pagination(endpoint, params)

def browse_user_journals(self, username, offset=0):
Expand Down

0 comments on commit c6cc86d

Please sign in to comment.