1
0
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:
Mike Fährmann 2022-05-20 22:32:35 +02:00
parent 64d3ad2e7a
commit 79dce8ae68
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 20 additions and 1 deletions

View File

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

View File

@ -296,7 +296,8 @@
},
"weasyl":
{
"api-key": null
"api-key": null,
"metadata": false
},
"weibo":
{

View File

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