1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[gelbooru] support authentication to enable api access

This commit is contained in:
Mike Fährmann 2015-11-06 14:14:29 +01:00
parent 8469b3ae4f
commit c05dbd15b5
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 10 additions and 1 deletions

View File

@ -33,7 +33,12 @@
"gelbooru":
{
"pattern": ["g(?:elbooru)?[.:-_](\\w.+)"],
"filename": "{category}_{id:>07}_{md5}.{extension}"
"filename": "{category}_{id:>07}_{md5}.{extension}",
"cookies":
{
"user_id": null,
"pass_hash": null,
}
}
}
}

View File

@ -9,6 +9,7 @@
"""Extract image-urls from http://gelbooru.com/"""
from .booru import XMLBooruExtractor
from .. import config
info = {
"category": "gelbooru",
@ -26,6 +27,9 @@ class GelbooruExtractor(XMLBooruExtractor):
XMLBooruExtractor.__init__(self, match, info)
self.api_url = "http://gelbooru.com/"
self.params = {"page":"dapi", "s":"post", "q":"index", "tags":self.tags}
self.session.cookies.update(
config.get(("extractor", info["category"], "cookies"))
)
def update_page(self, reset=False):
if reset is False: