[artstation] add extractor for artwork listings (#80)
like https://www.artstation.com/artwork?sorting=latest or https://www.artstation.com/artwork?sorting=picks
This commit is contained in:
@@ -104,7 +104,7 @@ Turboimagehost https://www.turboimagehost.com/ individual Images
|
|||||||
==================== =================================== ================================================== ================
|
==================== =================================== ================================================== ================
|
||||||
|
|
||||||
.. |Site-0| replace:: yuki.la 4chan archive
|
.. |Site-0| replace:: yuki.la 4chan archive
|
||||||
.. |Capabilities-0| replace:: Images from Users, Albums, Challenges, individual Images, Likes, Search Results
|
.. |Capabilities-0| replace:: Images from Users, Albums, Artwork Listings, Challenges, individual Images, Likes, Search Results
|
||||||
.. |Capabilities-1| replace:: Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images, Sta.sh
|
.. |Capabilities-1| replace:: Collections, Deviations, Favorites, Folders, Galleries, Journals, Popular Images, Sta.sh
|
||||||
.. |Capabilities-2| replace:: Images from Users, Albums, Favorites, Galleries, Groups, individual Images, Search Results
|
.. |Capabilities-2| replace:: Images from Users, Albums, Favorites, Galleries, Groups, individual Images, Search Results
|
||||||
.. |Capabilities-3| replace:: Images from Users, Favorites, individual Images, Popular Images, Recent Images, Scraps
|
.. |Capabilities-3| replace:: Images from Users, Favorites, individual Images, Popular Images, Recent Images, Scraps
|
||||||
|
|||||||
@@ -300,6 +300,29 @@ class ArtstationSearchExtractor(ArtstationExtractor):
|
|||||||
return self._pagination(url, params)
|
return self._pagination(url, params)
|
||||||
|
|
||||||
|
|
||||||
|
class ArtstationArtworkExtractor(ArtstationExtractor):
|
||||||
|
"""Extractor for projects on artstation's artwork page"""
|
||||||
|
subcategory = "artwork"
|
||||||
|
directory_fmt = ("{category}", "Artworks", "{artwork[sorting]!c}")
|
||||||
|
archive_fmt = "A_{asset[id]}"
|
||||||
|
pattern = (r"(?:https?://)?(?:\w+\.)?artstation\.com"
|
||||||
|
r"/artwork/?\?([^#]+)")
|
||||||
|
test = ("https://www.artstation.com/artwork?sorting=latest",)
|
||||||
|
|
||||||
|
def __init__(self, match):
|
||||||
|
ArtstationExtractor.__init__(self, match)
|
||||||
|
self.query = text.parse_query(match.group(1))
|
||||||
|
|
||||||
|
def metadata(self):
|
||||||
|
return {"artwork": self.query}
|
||||||
|
|
||||||
|
def projects(self):
|
||||||
|
url = "{}/projects.json".format(self.root)
|
||||||
|
params = self.query.copy()
|
||||||
|
params["page"] = 1
|
||||||
|
return self._pagination(url, params)
|
||||||
|
|
||||||
|
|
||||||
class ArtstationImageExtractor(ArtstationExtractor):
|
class ArtstationImageExtractor(ArtstationExtractor):
|
||||||
"""Extractor for images from a single artstation project"""
|
"""Extractor for images from a single artstation project"""
|
||||||
subcategory = "image"
|
subcategory = "image"
|
||||||
|
|||||||
Reference in New Issue
Block a user