[flickr] add 'metadata' option (#4227)
This commit is contained in:
@@ -1541,6 +1541,27 @@ Description
|
|||||||
from `linking your Flickr account to gallery-dl <OAuth_>`__.
|
from `linking your Flickr account to gallery-dl <OAuth_>`__.
|
||||||
|
|
||||||
|
|
||||||
|
extractor.flickr.metadata
|
||||||
|
-------------------------
|
||||||
|
Type
|
||||||
|
* ``bool``
|
||||||
|
* ``string``
|
||||||
|
* ``list`` of ``strings``
|
||||||
|
Default
|
||||||
|
``false``
|
||||||
|
Example
|
||||||
|
* ``license,last_update,machine_tags``
|
||||||
|
* ``["license", "last_update", "machine_tags"]``
|
||||||
|
Description
|
||||||
|
Extract additional metadata
|
||||||
|
(license, date_taken, original_format, last_update, geo, machine_tags, o_dims)
|
||||||
|
|
||||||
|
It is possible to specify a custom list of metadata includes.
|
||||||
|
See `the extras parameter <https://www.flickr.com/services/api/flickr.people.getPhotos.html>`__
|
||||||
|
in `Flickr API docs <https://www.flickr.com/services/api/>`__
|
||||||
|
for possible field names.
|
||||||
|
|
||||||
|
|
||||||
extractor.flickr.videos
|
extractor.flickr.videos
|
||||||
-----------------------
|
-----------------------
|
||||||
Type
|
Type
|
||||||
|
|||||||
@@ -451,9 +451,19 @@ class FlickrAPI(oauth.OAuth1API):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def _pagination(self, method, params, key="photos"):
|
def _pagination(self, method, params, key="photos"):
|
||||||
params["extras"] = ("description,date_upload,tags,views,media,"
|
extras = ("description,date_upload,tags,views,media,"
|
||||||
"path_alias,owner_name,")
|
"path_alias,owner_name,")
|
||||||
params["extras"] += ",".join("url_" + fmt[0] for fmt in self.formats)
|
includes = self.extractor.config("metadata")
|
||||||
|
if includes:
|
||||||
|
if isinstance(includes, (list, tuple)):
|
||||||
|
includes = ",".join(includes)
|
||||||
|
elif not isinstance(includes, str):
|
||||||
|
includes = ("license,date_taken,original_format,last_update,"
|
||||||
|
"geo,machine_tags,o_dims")
|
||||||
|
extras = extras + includes + ","
|
||||||
|
extras += ",".join("url_" + fmt[0] for fmt in self.formats)
|
||||||
|
|
||||||
|
params["extras"] = extras
|
||||||
params["page"] = 1
|
params["page"] = 1
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
|||||||
Reference in New Issue
Block a user