Skip to content

Commit

Permalink
[mangadex] add 'api-server' option (#1309)
Browse files Browse the repository at this point in the history
and change the API server back to 'https://mangadex.org/api' for now
  • Loading branch information
mikf committed Feb 11, 2021
1 parent 96a51ff commit 79c0fc2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gallery_dl/extractor/mangadex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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)
Expand Down

0 comments on commit 79c0fc2

Please sign in to comment.