1- import { toDebug , toLog } from './index'
1+ import { toDebug , toLog } from "./helpers"
22
33interface fetchHtmlResponse {
44 html ?: string
@@ -13,19 +13,18 @@ export interface Manifest {
1313 } [ ]
1414}
1515
16- const turnstileTitle = ' <title>Just a moment...</title>'
16+ const turnstileTitle = " <title>Just a moment...</title>"
1717
1818const headers : HeadersInit = {
19- 'Cache-Control' : 'max-age=0' ,
20- 'Accept-Language' : 'en-US;q=0.9,en;q=0.7' ,
21- 'Sec-Ch-Ua' : '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' ,
22- 'Sec-Ch-Ua-Mobile' : '?0' ,
23- 'Sec-Ch-Ua-Platform' : '"macOS"' ,
24- 'Sec-Fetch-Dest' : 'document' ,
25- 'Sec-Fetch-Site' : 'none' ,
26- 'Sec-Fetch-User' : '?1' ,
27- 'User-Agent' :
28- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36' ,
19+ "Cache-Control" : "max-age=0" ,
20+ "Accept-Language" : "en-US;q=0.9,en;q=0.7" ,
21+ "Sec-Ch-Ua" : '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"' ,
22+ "Sec-Ch-Ua-Mobile" : "?0" ,
23+ "Sec-Ch-Ua-Platform" : '"macOS"' ,
24+ "Sec-Fetch-Dest" : "document" ,
25+ "Sec-Fetch-Site" : "none" ,
26+ "Sec-Fetch-User" : "?1" ,
27+ "User-Agent" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" ,
2928}
3029
3130export async function fetchHtml ( url : string ) : Promise < fetchHtmlResponse > {
@@ -42,7 +41,7 @@ export async function fetchHtml(url: string): Promise<fetchHtmlResponse> {
4241 const isRedirect = resp . redirected
4342
4443 if ( isCaptcha ) {
45- toDebug ( ' html' , html )
44+ toDebug ( " html" , html )
4645 return { captchaProtected : true }
4746 }
4847
0 commit comments