Image Proxy
Technical details regarding the usage of the image proxy function for the weebcentral provider can be found below. This endpoint is used to bypass CORS and hotlink protection when loading manga images. Example code is provided for both JavaScript and Python, along with a response schema.
Route Schema (URL)
https://api.consumet.org/manga/weebcentral/proxy?url={url}Query Parameters
| Parameter | Type | Description | Required? | Default |
|---|---|---|---|---|
| url | string | The image URL to proxy (URL encoded if needed) | Yes |
Request Samples
import axios from "axios";
// Using an example image URL from chapter pages.
const imageUrl = "https://example.weebcentral.com/images/chapter1/page1.jpg";
const proxyUrl = `https://api.consumet.org/manga/weebcentral/proxy?url=${encodeURIComponent(imageUrl)}`;
// For displaying in HTML
const img = document.createElement('img');
img.src = proxyUrl;
document.body.appendChild(img);
// Or fetching as blob
const fetchImage = async () => {
try {
const response = await axios.get(proxyUrl, {
responseType: 'blob'
});
return response.data;
} catch (err) {
throw new Error(err.message);
}
};Usage with Chapter Pages
import axios from "axios";
// First, get chapter pages
const chapterUrl = "https://api.consumet.org/manga/weebcentral/read";
const getChapterPages = async () => {
try {
const { data } = await axios.get(chapterUrl, {
params: { chapterId: "01J76XY2R7G37RRFSQJXM2YHV8/chapter-1" }
});
// Convert image URLs to use proxy
const proxyBaseUrl = "https://api.consumet.org/manga/weebcentral/proxy?url=";
const pagesWithProxy = data.map(page => ({
...page,
img: proxyBaseUrl + encodeURIComponent(page.img)
}));
return pagesWithProxy;
} catch (err) {
throw new Error(err.message);
}
};
console.log(await getChapterPages());Response Schema
MIME Type: image/* (e.g., image/jpeg, image/png, image/webp)
Returns the raw image binary data with appropriate headers:
Content-Type: The original image content typeCache-Control:public, max-age=86400Access-Control-Allow-Origin:*
Why Use This Proxy?
Many manga websites implement hotlink protection and CORS policies that prevent images from being loaded directly in web applications. This proxy endpoint:
- Bypasses CORS: Adds appropriate CORS headers to allow cross-origin requests
- Bypasses Hotlink Protection: Sets the proper
Refererheader expected by the source - Caching: Implements caching headers for better performance
- User-Agent Spoofing: Uses a standard browser User-Agent to avoid blocks