diff --git a/app/api/adult/category/route.ts b/app/api/adult/category/route.ts index 20eea4f..1503c4a 100644 --- a/app/api/adult/category/route.ts +++ b/app/api/adult/category/route.ts @@ -1,6 +1,7 @@ import { NextResponse } from 'next/server'; import { ADULT_SOURCES } from '@/lib/api/adult-sources'; +export const runtime = 'edge'; export async function GET(request: Request) { const { searchParams } = new URL(request.url); const categoryParam = searchParams.get('category') || ''; // Format: "sourceId:typeId" or just "typeId" or empty diff --git a/app/api/detail/route.ts b/app/api/detail/route.ts index 0d36846..6f20219 100644 --- a/app/api/detail/route.ts +++ b/app/api/detail/route.ts @@ -7,6 +7,8 @@ import { NextRequest, NextResponse } from 'next/server'; import { getVideoDetail } from '@/lib/api/client'; import { getSourceById } from '@/lib/api/video-sources'; +export const runtime = 'edge'; + /** * Shared handler for fetching video details */ diff --git a/app/api/douban/recommend/route.ts b/app/api/douban/recommend/route.ts index 4d864ac..490cc3c 100644 --- a/app/api/douban/recommend/route.ts +++ b/app/api/douban/recommend/route.ts @@ -1,5 +1,7 @@ import { NextResponse } from 'next/server'; +export const runtime = 'edge'; + export async function GET(request: Request) { const { searchParams } = new URL(request.url); const tag = searchParams.get('tag') || '热门'; @@ -9,7 +11,7 @@ export async function GET(request: Request) { try { const url = `https://movie.douban.com/j/search_subjects?type=${type}&tag=${encodeURIComponent(tag)}&sort=recommend&page_limit=${pageLimit}&page_start=${pageStart}`; - + const response = await fetch(url, { headers: { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36', diff --git a/app/api/proxy/route.ts b/app/api/proxy/route.ts index 4245033..9ebafba 100644 --- a/app/api/proxy/route.ts +++ b/app/api/proxy/route.ts @@ -2,10 +2,9 @@ import { NextRequest, NextResponse } from 'next/server'; import { processM3u8Content } from '@/lib/utils/proxy-utils'; import { fetchWithRetry } from '@/lib/utils/fetch-with-retry'; -export const runtime = 'nodejs'; +export const runtime = 'edge'; -// Disable SSL verification for video sources with invalid certificates -process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; +// NOTE: process.env.NODE_TLS_REJECT_UNAUTHORIZED is not supported in Edge Runtime export async function GET(request: NextRequest) { const url = request.nextUrl.searchParams.get('url'); diff --git a/app/api/search-parallel/route.ts b/app/api/search-parallel/route.ts index 0620dac..3a778f1 100644 --- a/app/api/search-parallel/route.ts +++ b/app/api/search-parallel/route.ts @@ -9,6 +9,8 @@ import { searchVideos } from '@/lib/api/client'; import { getSourceById } from '@/lib/api/video-sources'; import { getSourceName } from '@/lib/utils/source-names'; +export const runtime = 'edge'; + export async function POST(request: NextRequest) { const encoder = new TextEncoder(); diff --git a/app/icon.png b/app/icon.png deleted file mode 100644 index b346b5f..0000000 Binary files a/app/icon.png and /dev/null differ diff --git a/tsconfig.json b/tsconfig.json index 3a13f90..2627c60 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,11 @@ { "compilerOptions": { "target": "ES2017", - "lib": ["dom", "dom.iterable", "esnext"], + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -11,7 +15,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "react-jsx", + "jsx": "preserve", "incremental": true, "plugins": [ { @@ -19,7 +23,9 @@ } ], "paths": { - "@/*": ["./*"] + "@/*": [ + "./*" + ] } }, "include": [ @@ -30,5 +36,7 @@ ".next/dev/types/**/*.ts", "**/*.mts" ], - "exclude": ["node_modules"] + "exclude": [ + "node_modules" + ] }