[deviantart] add 'watch' extractor (#794)

This commit is contained in:
Mike Fährmann
2021-03-17 22:50:02 +01:00
parent fcdda6128c
commit 69ca4e29f1
3 changed files with 19 additions and 1 deletions

View File

@@ -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"