mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[vsco] add 'include' option (#5911)
This commit is contained in:
parent
ff58683b76
commit
095f278d6f
@ -4300,6 +4300,29 @@ Description
|
||||
or `cookies <extractor.*.cookies_>`__
|
||||
|
||||
|
||||
extractor.vsco.include
|
||||
----------------------
|
||||
Type
|
||||
* ``string``
|
||||
* ``list`` of ``strings``
|
||||
Default
|
||||
``"gallery"``
|
||||
Example
|
||||
* ``"avatar,collection"``
|
||||
* ``["avatar", "collection"]``
|
||||
Description
|
||||
A (comma-separated) list of subcategories to include
|
||||
when processing a user profile.
|
||||
|
||||
Possible values are
|
||||
``"avatar"``,
|
||||
``"gallery"``,
|
||||
``"spaces"``,
|
||||
``"collection"``,
|
||||
|
||||
It is possible to use ``"all"`` instead of listing all values separately.
|
||||
|
||||
|
||||
extractor.vsco.videos
|
||||
---------------------
|
||||
Type
|
||||
|
@ -952,7 +952,7 @@ Consider all listed sites to potentially be NSFW.
|
||||
<tr>
|
||||
<td>VSCO</td>
|
||||
<td>https://vsco.co/</td>
|
||||
<td>Avatars, Collections, individual Images, Spaces, User Profiles</td>
|
||||
<td>Avatars, Collections, Galleries, individual Images, Spaces, User Profiles</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -115,9 +115,28 @@ class VscoExtractor(Extractor):
|
||||
|
||||
|
||||
class VscoUserExtractor(VscoExtractor):
|
||||
"""Extractor for images from a user on vsco.co"""
|
||||
"""Extractor for a vsco user profile"""
|
||||
subcategory = "user"
|
||||
pattern = USER_PATTERN + r"(?:/gallery|/images(?:/\d+)?)?/?(?:$|[?#])"
|
||||
pattern = USER_PATTERN + r"/?$"
|
||||
example = "https://vsco.co/USER"
|
||||
|
||||
def initialize(self):
|
||||
pass
|
||||
|
||||
def items(self):
|
||||
base = "{}/{}/".format(self.root, self.user)
|
||||
return self._dispatch_extractors((
|
||||
(VscoAvatarExtractor , base + "avatar"),
|
||||
(VscoGalleryExtractor , base + "gallery"),
|
||||
(VscoSpacesExtractor , base + "spaces"),
|
||||
(VscoCollectionExtractor, base + "collection"),
|
||||
), ("gallery",))
|
||||
|
||||
|
||||
class VscoGalleryExtractor(VscoExtractor):
|
||||
"""Extractor for a vsco user's gallery"""
|
||||
subcategory = "gallery"
|
||||
pattern = USER_PATTERN + r"/(?:gallery|images)"
|
||||
example = "https://vsco.co/USER/gallery"
|
||||
|
||||
def images(self):
|
||||
|
@ -9,9 +9,29 @@ from gallery_dl.extractor import vsco
|
||||
|
||||
__tests__ = (
|
||||
{
|
||||
"#url" : "https://vsco.co/missuri/gallery",
|
||||
"#url" : "https://vsco.co/missuri",
|
||||
"#category": ("", "vsco", "user"),
|
||||
"#class" : vsco.VscoUserExtractor,
|
||||
"#urls" : "https://vsco.co/missuri/gallery",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://vsco.co/missuri",
|
||||
"#category": ("", "vsco", "user"),
|
||||
"#class" : vsco.VscoUserExtractor,
|
||||
"#options" : {"include": "all"},
|
||||
"#urls" : [
|
||||
"https://vsco.co/missuri/avatar",
|
||||
"https://vsco.co/missuri/gallery",
|
||||
"https://vsco.co/missuri/spaces",
|
||||
"https://vsco.co/missuri/collection",
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://vsco.co/missuri/gallery",
|
||||
"#category": ("", "vsco", "gallery"),
|
||||
"#class" : vsco.VscoGalleryExtractor,
|
||||
"#pattern" : r"https://image(-aws.+)?\.vsco\.co/[0-9a-f/]+/[\w-]+\.\w+",
|
||||
"#range" : "1-80",
|
||||
"#count" : 80,
|
||||
@ -19,14 +39,8 @@ __tests__ = (
|
||||
|
||||
{
|
||||
"#url" : "https://vsco.co/missuri/images/1",
|
||||
"#category": ("", "vsco", "user"),
|
||||
"#class" : vsco.VscoUserExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://vsco.co/missuri",
|
||||
"#category": ("", "vsco", "user"),
|
||||
"#class" : vsco.VscoUserExtractor,
|
||||
"#category": ("", "vsco", "gallery"),
|
||||
"#class" : vsco.VscoGalleryExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user