1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 03:02:50 +01:00

[mangadex] add 'api-server' option (#1309)

and change the API server back to 'https://mangadex.org/api' for now
This commit is contained in:
Mike Fährmann 2021-02-11 19:52:16 +01:00
parent 96a51ff169
commit 79c0fc249b
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -17,7 +17,6 @@ class MangadexExtractor(Extractor):
"""Base class for mangadex extractors"""
category = "mangadex"
root = "https://mangadex.org"
api_root = "https://api.mangadex.org"
# mangadex-to-iso639-1 codes
iso639_map = {
@ -27,6 +26,10 @@ class MangadexExtractor(Extractor):
"vn": "vi",
}
def __init__(self, match):
Extractor.__init__(self, match)
self.api_root = self.config("api-server") or "https://mangadex.org/api"
def chapter_data(self, chapter_id):
"""Request API results for 'chapter_id'"""
url = "{}/v2/chapter/{}".format(self.api_root, chapter_id)