diff --git a/docs/configuration.rst b/docs/configuration.rst index 8dced28a..545e8108 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1171,6 +1171,16 @@ Description the first in the list gets chosen (usually `mp3`). +extractor.mangadex.api-server +----------------------------- +Type + ``string`` +Default + ``"https://api.mangadex.org"`` +Description + The server to use for API requests. + + extractor.newgrounds.flash -------------------------- Type diff --git a/gallery_dl/extractor/mangadex.py b/gallery_dl/extractor/mangadex.py index d59e5bbd..6decc7dc 100644 --- a/gallery_dl/extractor/mangadex.py +++ b/gallery_dl/extractor/mangadex.py @@ -17,6 +17,7 @@ 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 = { @@ -28,7 +29,10 @@ class MangadexExtractor(Extractor): def __init__(self, match): Extractor.__init__(self, match) - self.api_root = self.config("api-server") or "https://mangadex.org/api" + + server = self.config("api-server") + if server is not None: + self.api_root = server.rstrip("/") def chapter_data(self, chapter_id): """Request API results for 'chapter_id'"""