Skip to content

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

Merged
mikf merged 2 commits intomikf:masterfrom
nthduy:fix/batoto-broken-images
Dec 31, 2025
Merged

[batoto] replace k-subdomain image URLs with n-subdomain#8791
mikf merged 2 commits intomikf:masterfrom
nthduy:fix/batoto-broken-images

Conversation

@nthduy
Copy link
Contributor

@nthduy nthduy commented Dec 31, 2025

Fixes broken image downloads from batoto by automatically replacing k-subdomain image URLs with n-subdomain equivalents.

Batoto's k-subdomain image servers (e.g., k01.mbopg.org) are currently broken and return errors. The n-subdomain servers (e.g., n01.mbopg.org) serve the same images and are working correctly.

Example

Before: https://k01.mbopg.org/media/7006/9bd/.../file.webp
After: https://n01.mbopg.org/media/7006/9bd/.../file.webp

Update tests to use battwo.com proxy domain and current metadata
@mikf
Copy link
Owner

mikf commented Dec 31, 2025

Erreur 503 - Service temporairement indisponible ou en maintenance

Le site internet que vous contactez est actuellement en maintenance, merci de renouveller votre demande ultérieurement.

How long has this maintenance been going on?
I'd expect this to resolve itself in a few days under normal circumstances.

@nthduy
Copy link
Contributor Author

nthduy commented Dec 31, 2025

image Here is a screenshot from their official discord, the situation have been going on for more than a month unfortunately.

@mikf
Copy link
Owner

mikf commented Dec 31, 2025

That's related the site itself, but not the image servers like mbxma.org as far as I can tell.
https://k04.mbxma.org/media/7006/a4d/60a00a6257a0cdad2ae84d4a/6600527_940_1996_94864.webp


That aside, do you have an example where the ".mb" in url check is necessary?

@nthduy
Copy link
Contributor Author

nthduy commented Dec 31, 2025

Sure, here it is https://k07.mbopg.org/media/00005/images/73/44/7344ac7e75fdd842f009c0147354ee3d07f12f0b_166253_1200_863.jpg . I forgot to put a disclaimer that the fix is from their community, they have a bookmark version that you can run in the browser console, i simply translate it to python.

setInterval(function(){const fix=str=>str.replace(/\/\/k/g,"//n");document.querySelectorAll("img").forEach(img=>{const props=["src","data-src","data-original","srcset","data-srcset"];props.forEach(p=>{let val=img.getAttribute(p);if(val && val.includes("//k") && val.includes(".mb")){img.setAttribute(p,fix(val));}});if(img.src && img.src.includes("//k") && img.src.includes(".mb")){img.src=fix(img.src);}});},2000);

A more detailled version
https://github.com/Sumon-Kayal/Universal-Batoto-Image-Fixer/blob/2cd4de65afcab0cdcf130a4be785d47bd951ba45/fixer.js#L454

@mikf mikf merged commit 2087730 into mikf:master Dec 31, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants