[deviantart] add 'watch' extractor (#794)
This commit is contained in:
@@ -889,6 +889,17 @@ class DeviantartFollowingExtractor(DeviantartExtractor):
|
||||
yield Message.Queue, url, user
|
||||
|
||||
|
||||
class DeviantartWatchExtractor(DeviantartExtractor):
|
||||
"""Extractor for Deviations from watched users"""
|
||||
subcategory = "watch"
|
||||
directory_fmt = ("{category}", "{author[username]}")
|
||||
pattern = r"(?:https?://)?(?:www\.)?deviantart\.com/notifications(/)watch/"
|
||||
test = ("https://www.deviantart.com/notifications/watch/",)
|
||||
|
||||
def deviations(self):
|
||||
return self.api.browse_deviantsyouwatch()
|
||||
|
||||
|
||||
###############################################################################
|
||||
# API Interfaces ##############################################################
|
||||
|
||||
@@ -933,6 +944,12 @@ class DeviantartOAuthAPI():
|
||||
self.client_id,
|
||||
)
|
||||
|
||||
def browse_deviantsyouwatch(self, offset=0):
|
||||
"""Yield deviations from users you watch"""
|
||||
endpoint = "browse/deviantsyouwatch"
|
||||
params = {"limit": "50", "offset": offset}
|
||||
return self._pagination(endpoint, params, public=False)
|
||||
|
||||
def browse_popular(self, query=None, timerange=None, offset=0):
|
||||
"""Yield popular deviations"""
|
||||
endpoint = "browse/popular"
|
||||
|
||||
Reference in New Issue
Block a user