[vsco] implement 'videos' option
This commit is contained in:
@@ -1082,6 +1082,15 @@ Description Control video download behavior.
|
|||||||
=========== =====
|
=========== =====
|
||||||
|
|
||||||
|
|
||||||
|
extractor.vsco.videos
|
||||||
|
---------------------
|
||||||
|
=========== =====
|
||||||
|
Type ``bool``
|
||||||
|
Default ``true``
|
||||||
|
Description Download video files.
|
||||||
|
=========== =====
|
||||||
|
|
||||||
|
|
||||||
extractor.wallhaven.api-key
|
extractor.wallhaven.api-key
|
||||||
---------------------------
|
---------------------------
|
||||||
=========== =====
|
=========== =====
|
||||||
|
|||||||
@@ -146,6 +146,10 @@
|
|||||||
"retweets": true,
|
"retweets": true,
|
||||||
"videos": false
|
"videos": false
|
||||||
},
|
},
|
||||||
|
"vsco":
|
||||||
|
{
|
||||||
|
"videos": true
|
||||||
|
},
|
||||||
"wallhaven":
|
"wallhaven":
|
||||||
{
|
{
|
||||||
"api-key": null
|
"api-key": null
|
||||||
|
|||||||
@@ -29,11 +29,14 @@ class VscoExtractor(Extractor):
|
|||||||
self.user = match.group(1).lower()
|
self.user = match.group(1).lower()
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
|
videos = self.config("videos", True)
|
||||||
yield Message.Version, 1
|
yield Message.Version, 1
|
||||||
yield Message.Directory, {"user": self.user}
|
yield Message.Directory, {"user": self.user}
|
||||||
for img in self.images():
|
for img in self.images():
|
||||||
|
|
||||||
if img["is_video"]:
|
if img["is_video"]:
|
||||||
|
if not videos:
|
||||||
|
continue
|
||||||
url = "https://" + img["video_url"]
|
url = "https://" + img["video_url"]
|
||||||
else:
|
else:
|
||||||
base = img["responsive_url"].partition("/")[2]
|
base = img["responsive_url"].partition("/")[2]
|
||||||
|
|||||||
Reference in New Issue
Block a user