1
0
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:
Mike Fährmann 2024-07-31 12:32:04 +02:00
parent ff58683b76
commit 095f278d6f
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
4 changed files with 68 additions and 12 deletions

View File

@ -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

View File

@ -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>

View File

@ -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):

View File

@ -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,
},
{