mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[deviantart] add 'watch' extractor (#794)
This commit is contained in:
parent
fcdda6128c
commit
69ca4e29f1
@ -106,7 +106,7 @@ Consider all sites to be NSFW unless otherwise known.
|
||||
<tr>
|
||||
<td>DeviantArt</td>
|
||||
<td>https://www.deviantart.com/</td>
|
||||
<td>Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images, Scraps, Sta.sh, User Profiles</td>
|
||||
<td>Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images, Scraps, Sta.sh, User Profiles, Watches</td>
|
||||
<td><a href="https://github.com/mikf/gallery-dl#oauth">OAuth</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -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"
|
||||
|
@ -123,6 +123,7 @@ SUBCATEGORY_MAP = {
|
||||
"status" : "Images from Statuses",
|
||||
"tag" : "Tag Searches",
|
||||
"user" : "User Profiles",
|
||||
"watch" : "Watches",
|
||||
"following" : "",
|
||||
"related-pin" : "related Pins",
|
||||
"related-board": "",
|
||||
|
Loading…
Reference in New Issue
Block a user