[batoto] fix downloading manga with alerts/notices (#7657)

and improve alert message extraction
This commit is contained in:
Mike Fährmann
2025-06-12 08:24:43 +02:00
parent 847fce6ef1
commit 16fc5e0d68
2 changed files with 18 additions and 5 deletions

View File

@@ -7,7 +7,7 @@
"""Extractors for https://bato.to/"""
from .common import Extractor, ChapterExtractor, MangaExtractor
from .. import text, util, exception
from .. import text, util
BASE_PATTERN = (r"(?:https?://)?("
r"(?:ba|d|f|h|j|m|w)to\.to|"
@@ -152,9 +152,9 @@ class BatotoMangaExtractor(BatotoBase, MangaExtractor):
def chapters(self, page):
extr = text.extract_from(page)
warning = extr(' class="alert alert-warning">', "</div><")
warning = extr(' class="alert alert-warning">', "</div>")
if warning:
raise exception.StopExtraction("'%s'", text.remove_html(warning))
self.log.warning("'%s'", text.remove_html(warning))
data = {
"manga_id": text.parse_int(self.manga_id),