From 98215032268b8e6a83aad2ea80ef5d12e3912f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 14 Nov 2024 23:44:15 +0100 Subject: [PATCH] [misc] 'api_root' -> 'root_api' --- gallery_dl/extractor/gelbooru_v02.py | 6 +++--- gallery_dl/extractor/piczel.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gallery_dl/extractor/gelbooru_v02.py b/gallery_dl/extractor/gelbooru_v02.py index 0baad2fa..aad5752c 100644 --- a/gallery_dl/extractor/gelbooru_v02.py +++ b/gallery_dl/extractor/gelbooru_v02.py @@ -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", diff --git a/gallery_dl/extractor/piczel.py b/gallery_dl/extractor/piczel.py index 422325ff..fe267042 100644 --- a/gallery_dl/extractor/piczel.py +++ b/gallery_dl/extractor/piczel.py @@ -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(),)