mirror of
https://git.roussel.pro/public-website/singapore_rain_radar.git
synced 2026-02-09 02:20:17 +01:00
updated headers to prevent 302 error
This commit is contained in:
@@ -22,18 +22,18 @@ function downloadImage(time_string, filepath) {
|
|||||||
headers: {
|
headers: {
|
||||||
"Host":"www.nea.gov.sg",
|
"Host":"www.nea.gov.sg",
|
||||||
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0",
|
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0",
|
||||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8",
|
"Accept": "image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5",
|
||||||
"Accept-Language": "en-US,en;q=0.5",
|
"Accept-Language": "en-US,en;q=0.5",
|
||||||
"Accept-Encoding": "gzip, deflate, br, zstd",
|
"Accept-Encoding": "gzip, deflate, br, zstd",
|
||||||
"DNT": "1",
|
"DNT": "1",
|
||||||
"Connection": "keep-alive",
|
"Connection": "keep-alive",
|
||||||
"Upgrade-Insecure-Requests": "1",
|
"Sec-Fetch-Dest": "image",
|
||||||
"Sec-Fetch-Dest": "document",
|
"Sec-Fetch-Mode": "no-cors",
|
||||||
"Sec-Fetch-Mode": "navigate",
|
"Sec-Fetch-Site": "same-origin",
|
||||||
"Sec-Fetch-Site": "cross-site",
|
"Priority": "u=5, i",
|
||||||
"Priority": "u=0, i",
|
|
||||||
"Pragma": "no-cache",
|
"Pragma": "no-cache",
|
||||||
"Cache-Control": "no-cache",
|
"Cache-Control": "no-cache",
|
||||||
|
"TE": "trailers",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client.get(options, (res) => {
|
client.get(options, (res) => {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { initImages, updateImages } from './generate.mjs';
|
import { initImages, updateImages } from './downloader.mjs';
|
||||||
|
|
||||||
initImages(10).then(() => {
|
initImages(10).then(() => {
|
||||||
console.log('Downloaded initial images successfully');
|
console.log('Downloaded initial images successfully');
|
||||||
|
|||||||
@@ -7,6 +7,9 @@
|
|||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "node index.mjs"
|
"start": "node index.mjs"
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"canvas": "^2.11.2"
|
||||||
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user