add useragent headers

This commit is contained in:
2024-07-17 10:24:07 +02:00
parent 9f71ad0f8e
commit a848f078be
4 changed files with 60 additions and 9 deletions

View File

@@ -1,6 +1,12 @@
async function checkImageExists(url) {
try {
const response = await fetch(url, { method: "HEAD" });
const response = await fetch(url, {
method: "HEAD",
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 Edg/128.0.0.0",
},
});
if (!response.ok) {
return false;
}