[batoto] replace k-subdomain image URLs with n-subdomain (#8791)

* [batoto] replace k-subdomain image URLs with n-subdomain
    Update tests to use battwo.com proxy domain and current metadata
* [batoto] revert to list comprehension
This commit is contained in:
Duy NGUYEN
2025-12-31 16:32:03 +01:00
committed by GitHub
parent add9fbc13b
commit 2087730b75
2 changed files with 22 additions and 20 deletions

View File

@@ -127,11 +127,13 @@ class BatotoChapterExtractor(BatotoBase, ChapterExtractor):
}
def images(self, page):
images_container = text.extr(page, 'pageOpts', ':[0,0]}"')
images_container = text.unescape(images_container)
container = text.unescape(text.extr(page, 'pageOpts', ':[0,0]}"'))
return [
(url, None)
for url in text.extract_iter(images_container, r"\"", r"\"")
((url.replace("://k", "://n", 1)
if url.startswith("https://k") and ".mb" in url else
url), None)
for url in text.extract_iter(container, r"\"", r"\"")
]