Skip to content

Commit

Permalink
[mangadex] re-enable warning for external chapters (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jan 16, 2022
1 parent f2e8aed commit c587b67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gallery_dl/extractor/mangadex.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-

# Copyright 2018-2021 Mike Fährmann
# Copyright 2018-2022 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
Expand Down Expand Up @@ -73,6 +73,7 @@ def _transform(self, chapter):
"lang" : lang,
"language": util.code_to_language(lang),
"count" : cattributes["pages"],
"_external_url": cattributes.get("externalUrl"),
}

data["artist"] = [artist["attributes"]["name"]
Expand Down Expand Up @@ -112,6 +113,12 @@ def items(self):
chapter = self.api.chapter(self.uuid)
data = self._transform(chapter)

if data.get("_external_url"):
raise exception.StopExtraction(
"Chapter %s%s is not available on MangaDex and can instead be "
"read on the official publisher's website at %s.",
data["chapter"], data["chapter_minor"], data["_external_url"])

yield Message.Directory, data
data["_http_headers"] = self._headers

Expand Down

0 comments on commit c587b67

Please sign in to comment.