[artstation] add 'following' extractor (closes #888)
This commit is contained in:
@@ -380,3 +380,21 @@ class ArtstationImageExtractor(ArtstationExtractor):
|
|||||||
|
|
||||||
def get_project_assets(self, project_id):
|
def get_project_assets(self, project_id):
|
||||||
return self.assets
|
return self.assets
|
||||||
|
|
||||||
|
|
||||||
|
class ArtstationFollowingExtractor(ArtstationExtractor):
|
||||||
|
"""Extractor for a user's followed users"""
|
||||||
|
subcategory = "following"
|
||||||
|
pattern = (r"(?:https?://)?(?:www\.)?artstation\.com"
|
||||||
|
r"/(?!artwork|projects|search)([^/?&#]+)/following")
|
||||||
|
test = ("https://www.artstation.com/gaerikim/following", {
|
||||||
|
"pattern": ArtstationUserExtractor.pattern,
|
||||||
|
"count": ">= 50",
|
||||||
|
})
|
||||||
|
|
||||||
|
def items(self):
|
||||||
|
url = "{}/users/{}/following.json".format(self.root, self.user)
|
||||||
|
for user in self._pagination(url):
|
||||||
|
url = "{}/{}".format(self.root, user["username"])
|
||||||
|
user["_extractor"] = ArtstationUserExtractor
|
||||||
|
yield Message.Queue, url, user
|
||||||
|
|||||||
Reference in New Issue
Block a user