1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2025-01-31 19:51:34 +01:00

[artstation] add 'following' extractor (closes #888)

This commit is contained in:
Mike Fährmann 2020-07-12 23:03:05 +02:00
parent 3855d0dd3c
commit d594977ca1
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -380,3 +380,21 @@ class ArtstationImageExtractor(ArtstationExtractor):
def get_project_assets(self, project_id):
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