修复链接,video部分改变权重

This commit is contained in:
wood chen 2024-01-16 21:59:13 +08:00
parent 782adaf8eb
commit fe8dda676b
3 changed files with 13 additions and 11 deletions

View File

@ -1,2 +1,9 @@
https://cdn-img.czl.net/woodchenink/2024/1/16/%E6%B5%AA%E5%AE%A2%E5%89%91%E5%BF%83%E8%BF%BD%E5%BF%86%E7%AF%8730%E5%B8%A71080P%E6%97%A0%E5%A3%B0%E9%9F%B3.mp4
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
https://t.mwm.moe/acg/acg
1 https://cdn-img.czl.net/woodchenink/2024/1/16/%E6%B5%AA%E5%AE%A2%E5%89%91%E5%BF%83%E8%BF%BD%E5%BF%86%E7%AF%8730%E5%B8%A71080P%E6%97%A0%E5%A3%B0%E9%9F%B3.mp4
2 https://t.mwm.moe/acg/acg
3 https://t.mwm.moe/acg/acg
4 https://t.mwm.moe/acg/acg
5 https://t.mwm.moe/acg/acg
6 https://t.mwm.moe/acg/acg
7 https://t.mwm.moe/acg/acg
8 https://t.mwm.moe/acg/acg
9 https://t.mwm.moe/acg/acg

View File

@ -1,5 +1,5 @@
// 外部 JSON 文件的 URL
const CSV_PATHS_URL = 'https://raw.githubusercontent.com/woodchen-ink/Random-Api/master/url.json';
const CSV_PATHS_URL = 'https://raw.githubusercontent.com/woodchen-ink/Random-Api/main/url.json';
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
@ -36,19 +36,14 @@ async function handleRequest(request) {
const randomIndex = Math.floor(Math.random() * fileArray.length);
const randomUrl = fileArray[randomIndex];
// 用原请求的头部创建新的请求对象
const resourceRequest = new Request(randomUrl, {
headers: request.headers
});
// 直接从随机 URL 获取图片内容并返回
return fetch(resourceRequest);
// 返回302重定向到randomUrl,1更快2方便排查
return Response.redirect(randomUrl, 302);
} else {
return new Response('CSV file could not be fetched.', { status: 500 });
}
} else {
// 如果不是 CSV 资源路径,返回 index.html 内容
const indexHtmlResponse = await fetch('https://raw.githubusercontent.com/woodchen-ink/Random-Api/master/index.html');
const indexHtmlResponse = await fetch('https://raw.githubusercontent.com/woodchen-ink/Random-Api/main/index.html');
return new Response(indexHtmlResponse.body, {
headers: { 'Content-Type': 'text/html' },
});

View File

@ -1,5 +1,5 @@
// 外部 JSON 文件的 URL
const CSV_PATHS_URL = 'https://raw.githubusercontent.com/woodchen-ink/Random-Api/master/url.json';
const CSV_PATHS_URL = 'https://raw.githubusercontent.com/woodchen-ink/Random-Api/main/url.json';
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
@ -48,7 +48,7 @@ async function handleRequest(request) {
}
} else {
// 如果不是 CSV 资源路径,返回 index.html 内容
const indexHtmlResponse = await fetch('https://raw.githubusercontent.com/woodchen-ink/Random-Api/master/index.html');
const indexHtmlResponse = await fetch('https://raw.githubusercontent.com/woodchen-ink/Random-Api/main/index.html');
return new Response(indexHtmlResponse.body, {
headers: { 'Content-Type': 'text/html' },
});