[unsplash] add 'format' option (#1197)
This commit is contained in:
@@ -1600,6 +1600,19 @@ Description
|
|||||||
* ``false``: Skip video Tweets
|
* ``false``: Skip video Tweets
|
||||||
|
|
||||||
|
|
||||||
|
extractor.unsplash.format
|
||||||
|
-------------------------
|
||||||
|
Type
|
||||||
|
``string``
|
||||||
|
Default
|
||||||
|
``"raw"``
|
||||||
|
Description
|
||||||
|
Name of the image format to download.
|
||||||
|
|
||||||
|
Available formats are
|
||||||
|
``"raw"``, ``"full"``, ``"regular"``, ``"small"``, and ``"thumb"``.
|
||||||
|
|
||||||
|
|
||||||
extractor.vsco.videos
|
extractor.vsco.videos
|
||||||
---------------------
|
---------------------
|
||||||
Type
|
Type
|
||||||
|
|||||||
@@ -27,10 +27,11 @@ class UnsplashExtractor(Extractor):
|
|||||||
self.item = match.group(1)
|
self.item = match.group(1)
|
||||||
|
|
||||||
def items(self):
|
def items(self):
|
||||||
|
fmt = self.config("format") or "raw"
|
||||||
for photo in self.photos():
|
for photo in self.photos():
|
||||||
util.delete_items(
|
util.delete_items(
|
||||||
photo, ("current_user_collections", "related_collections"))
|
photo, ("current_user_collections", "related_collections"))
|
||||||
url = photo["urls"]["raw"]
|
url = photo["urls"][fmt]
|
||||||
text.nameext_from_url(url, photo)
|
text.nameext_from_url(url, photo)
|
||||||
|
|
||||||
photo["extension"] = "jpg"
|
photo["extension"] = "jpg"
|
||||||
|
|||||||
Reference in New Issue
Block a user