mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[weasyl] implement 'metadata' option (#2610)
This commit is contained in:
parent
64d3ad2e7a
commit
79dce8ae68
@ -2435,6 +2435,20 @@ Description
|
||||
to use your account's browsing settings and filters.
|
||||
|
||||
|
||||
extractor.weasyl.metadata
|
||||
-------------------------
|
||||
Type
|
||||
``bool``
|
||||
Default
|
||||
``false``
|
||||
Description
|
||||
| Fetch extra submission metadata during gallery downloads.
|
||||
| (``comments``, ``description``, ``favorites``, ``folder_name``,
|
||||
``tags``, ``views``)
|
||||
|
||||
Note: This requires 1 additional HTTP request per submission.
|
||||
|
||||
|
||||
extractor.weibo.retweets
|
||||
------------------------
|
||||
Type
|
||||
|
@ -296,7 +296,8 @@
|
||||
},
|
||||
"weasyl":
|
||||
{
|
||||
"api-key": null
|
||||
"api-key": null,
|
||||
"metadata": false
|
||||
},
|
||||
"weibo":
|
||||
{
|
||||
|
@ -47,6 +47,7 @@ class WeasylExtractor(Extractor):
|
||||
return data
|
||||
|
||||
def submissions(self, owner_login, folderid=None):
|
||||
metadata = self.config("metadata")
|
||||
url = "{}/api/users/{}/gallery".format(self.root, owner_login)
|
||||
params = {
|
||||
"nextid" : None,
|
||||
@ -56,6 +57,9 @@ class WeasylExtractor(Extractor):
|
||||
while True:
|
||||
data = self.request(url, params=params).json()
|
||||
for submission in data["submissions"]:
|
||||
if metadata:
|
||||
submission = self.request_submission(
|
||||
submission["submitid"])
|
||||
if self.populate_submission(submission):
|
||||
submission["folderid"] = folderid
|
||||
# Do any submissions have more than one url? If so
|
||||
|
Loading…
Reference in New Issue
Block a user