1
0
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:
Mike Fährmann 2021-03-17 22:50:02 +01:00
parent fcdda6128c
commit 69ca4e29f1
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 19 additions and 1 deletions

View File

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

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"

View File

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