mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-24 19:52:32 +01:00
[misc] 'api_root' -> 'root_api'
This commit is contained in:
parent
e763efd36c
commit
9821503226
@ -22,14 +22,14 @@ class GelbooruV02Extractor(booru.BooruExtractor):
|
||||
def _init(self):
|
||||
self.api_key = self.config("api-key")
|
||||
self.user_id = self.config("user-id")
|
||||
self.api_root = self.config_instance("api_root") or self.root
|
||||
self.root_api = self.config_instance("root-api") or self.root
|
||||
|
||||
if self.category == "realbooru":
|
||||
self.items = self._items_realbooru
|
||||
self._tags = self._tags_realbooru
|
||||
|
||||
def _api_request(self, params):
|
||||
url = self.api_root + "/index.php?page=dapi&s=post&q=index"
|
||||
url = self.root_api + "/index.php?page=dapi&s=post&q=index"
|
||||
return ElementTree.fromstring(self.request(url, params=params).text)
|
||||
|
||||
def _pagination(self, params):
|
||||
@ -191,8 +191,8 @@ BASE_PATTERN = GelbooruV02Extractor.update({
|
||||
},
|
||||
"rule34": {
|
||||
"root": "https://rule34.xxx",
|
||||
"root-api": "https://api.rule34.xxx",
|
||||
"pattern": r"(?:www\.)?rule34\.xxx",
|
||||
"api_root": "https://api.rule34.xxx",
|
||||
},
|
||||
"safebooru": {
|
||||
"root": "https://safebooru.org",
|
||||
|
@ -19,7 +19,7 @@ class PiczelExtractor(Extractor):
|
||||
filename_fmt = "{category}_{id}_{title}_{num:>02}.{extension}"
|
||||
archive_fmt = "{id}_{num}"
|
||||
root = "https://piczel.tv"
|
||||
api_root = root
|
||||
root_api = root
|
||||
|
||||
def items(self):
|
||||
for post in self.posts():
|
||||
@ -75,7 +75,7 @@ class PiczelUserExtractor(PiczelExtractor):
|
||||
self.user = match.group(1)
|
||||
|
||||
def posts(self):
|
||||
url = "{}/api/users/{}/gallery".format(self.api_root, self.user)
|
||||
url = "{}/api/users/{}/gallery".format(self.root_api, self.user)
|
||||
return self._pagination(url)
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ class PiczelFolderExtractor(PiczelExtractor):
|
||||
self.user, self.folder_id = match.groups()
|
||||
|
||||
def posts(self):
|
||||
url = "{}/api/users/{}/gallery".format(self.api_root, self.user)
|
||||
url = "{}/api/users/{}/gallery".format(self.root_api, self.user)
|
||||
return self._pagination(url, int(self.folder_id))
|
||||
|
||||
|
||||
@ -108,5 +108,5 @@ class PiczelImageExtractor(PiczelExtractor):
|
||||
self.image_id = match.group(1)
|
||||
|
||||
def posts(self):
|
||||
url = "{}/api/gallery/{}".format(self.api_root, self.image_id)
|
||||
url = "{}/api/gallery/{}".format(self.root_api, self.image_id)
|
||||
return (self.request(url).json(),)
|
||||
|
Loading…
Reference in New Issue
Block a user