[deviantart] add 'watch' extractor (#794)
This commit is contained in:
@@ -106,7 +106,7 @@ Consider all sites to be NSFW unless otherwise known.
|
|||||||
<tr>
|
<tr>
|
||||||
<td>DeviantArt</td>
|
<td>DeviantArt</td>
|
||||||
<td>https://www.deviantart.com/</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>
|
<td><a href="https://github.com/mikf/gallery-dl#oauth">OAuth</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -889,6 +889,17 @@ class DeviantartFollowingExtractor(DeviantartExtractor):
|
|||||||
yield Message.Queue, url, user
|
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 ##############################################################
|
# API Interfaces ##############################################################
|
||||||
|
|
||||||
@@ -933,6 +944,12 @@ class DeviantartOAuthAPI():
|
|||||||
self.client_id,
|
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):
|
def browse_popular(self, query=None, timerange=None, offset=0):
|
||||||
"""Yield popular deviations"""
|
"""Yield popular deviations"""
|
||||||
endpoint = "browse/popular"
|
endpoint = "browse/popular"
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ SUBCATEGORY_MAP = {
|
|||||||
"status" : "Images from Statuses",
|
"status" : "Images from Statuses",
|
||||||
"tag" : "Tag Searches",
|
"tag" : "Tag Searches",
|
||||||
"user" : "User Profiles",
|
"user" : "User Profiles",
|
||||||
|
"watch" : "Watches",
|
||||||
"following" : "",
|
"following" : "",
|
||||||
"related-pin" : "related Pins",
|
"related-pin" : "related Pins",
|
||||||
"related-board": "",
|
"related-board": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user