TachibanaGeneralLaboratories / download-navi

Free and Open Source software download manager
GNU General Public License v3.0
812 stars 86 forks source link

[Cloudflare] HTTP 503 Service Temporarily Unavailable #213

Open Kita2345 opened 2 years ago

Kita2345 commented 2 years ago

Link https://download.fastgit.org/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0.tar.xz

proninyaroslav commented 2 years ago

I will assume that this is due to DDoS protection from Cloudflare. I will check it.

proninyaroslav commented 2 years ago

Well, it's Cloudflare's fault. Moreover, this doesn't work even with the built-in browser, which is strange, since the browser passes cookies to the downloader, which are necessary for authorization. Probably Cloudflare now requires more than just cookies. I had no experience with Cloudflare and it will take time to learn it. I would be grateful if someone could provide information on this matter.

hsoftxl commented 2 years ago

@proninyaroslav i find same thing. it need headers like this, Map<String,String> header = new HashMap<>(); if (url.toString().contains("xxx.cc")) { header.put("Content-Type", "application/octet-stream"); header.put("referer", "https://xxx.com/"); header.put("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9"); header.put("accept-encoding", "gzip, deflate, br"); // header.put(":authority", url.getAuthority()); header.put(":authority", "s3.x.comxx"); header.put(":method", "GET"); header.put(":path", url.getPath()); header.put(":scheme", url.getProtocol()); header.put("accept-language", "zh-CN,zh;q=0.9"); header.put("user-agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"); } header.put("sec-ch-ua","\"Chromium\";v=\"21\", \" Not;A Brand\";v=\"99\""); header.put("sec-ch-ua-mobile","?0"); header.put("sec-ch-ua-platform","Windows"); header.put("sec-fetch-dest","document"); header.put("sec-fetch-mode","navigate"); header.put("sec-fetch-site","cross-site"); header.put("sec-fetch-user","?1"); header.put("upgrade-insecure-requests","1");

i add these headers , it can download , but in pc speed is 2M , in phone is 50K, and it can not support accept-ranges: bytes