Hotlink Protection issues [Fixed]

Status
Not open for further replies.
Contributor
Joined
Apr 28, 2020
Messages
134
Using the API to retrieve chapter images, results in the Hotlink Protection images being served instead (but only for specific images, like page 8-18 in this example).

python example:
Python:
import requests
import os


chapter_id = "9dbb80bc-da29-4ab6-915e-b068667123d3"
base_url = "https://api.mangadex.org"
folder_path = f"chapters/{chapter_id}"

r = requests.get(f"{base_url}/at-home/server/{chapter_id}")
r_json = r.json()

host = r_json["baseUrl"]
chapter_hash = r_json["chapter"]["hash"]
data = r_json["chapter"]["data"]
data_saver = r_json["chapter"]["dataSaver"]
os.makedirs(folder_path, exist_ok=True)
for page in data:
    r = requests.get(f"{host}/data/{chapter_hash}/{page}")

    with open(f"{folder_path}/{page}", mode="wb") as f:
        f.write(r.content)

print(f"Downloaded {len(data)} pages.")

but using the original host (uploads.mangadex.org), passing a random parameter (like ?Random+Param=Random+Value) to the image requests, or using the data-saver images, results in the actual chapter pages being served.

And another weird thing I have noticed is that the images from this MD@Home node are actually hotlinkable....

Note: this might be specific to a MD@Home node, so not reproducible by everyone.
 
Last edited:
Status
Not open for further replies.

Users who are viewing this thread

Top