diff --git a/src/RandomAnimeGirl.tsx b/src/RandomAnimeGirl.tsx index 60403fb..1a3ba46 100644 --- a/src/RandomAnimeGirl.tsx +++ b/src/RandomAnimeGirl.tsx @@ -88,10 +88,10 @@ async function getImage(data: ApiResponse): Promise { if (data.source == undefined || data.source.direct == null) { return null } - const url = data.source.direct.replace('i.pximg.net', 'p.lolicon.cyou') + const url = data.source.direct.replace('i.pximg.net', 'pixiv.lolicon.cyou') let result: Blob | null = null - const response = await fetch(url, { method: "GET" }) + const response = await fetch(url, { method: "GET" ,redirect: 'follow'}) if (response.status != 200) { if (response.status == 404 && data.image != undefined) { // 尝试使用备用的 @@ -127,8 +127,7 @@ function handleGetImage(type: string | null, setter: React.Dispatch { try { const result = await api.getFromEndpoint(endpoint) - const image = null - // const image = await getImage(result) + const image = await getImage(result) if (image != null) { setter(URL.createObjectURL(image)); } else {