@@ -10,7 +10,7 @@ import { lookup } from 'node:dns/promises'
1010
1111const FETCH_TIMEOUT = 10000
1212const MAX_BODY_SIZE = 2 * 1024 * 1024 // 2MB limit for HTML
13- const USER_AGENT = 'Mozilla/5.0 (compatible; Hypermark/1.0; +https://hypermark.app) '
13+ const USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 '
1414
1515// Cache: domain -> { result, expiresAt }
1616const metadataCache = new Map ( )
@@ -169,7 +169,14 @@ async function fetchPage(url) {
169169 signal : controller . signal ,
170170 headers : {
171171 'User-Agent' : USER_AGENT ,
172- 'Accept' : 'text/html,application/xhtml+xml' ,
172+ 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' ,
173+ 'Accept-Language' : 'en-US,en;q=0.9' ,
174+ 'Accept-Encoding' : 'gzip, deflate, br' ,
175+ 'Cache-Control' : 'no-cache' ,
176+ 'Sec-Fetch-Dest' : 'document' ,
177+ 'Sec-Fetch-Mode' : 'navigate' ,
178+ 'Sec-Fetch-Site' : 'none' ,
179+ 'Sec-Fetch-User' : '?1' ,
173180 } ,
174181 redirect : 'follow' ,
175182 } )
0 commit comments