小雅对id进行base58

This commit is contained in:
mtvpls
2026-01-11 22:05:32 +08:00
parent b6026199e3
commit 30278b3ac1
5 changed files with 99 additions and 11 deletions
+7 -2
View File
@@ -60,6 +60,7 @@ async function getFinalUrl(url: string, maxRedirects = 5): Promise<string> {
/**
* GET /api/xiaoya/play?path=<path>
* 获取小雅视频的播放链接(优先使用视频预览流,失败时降级到直连)
* path参数为base58编码的路径
*/
export async function GET(request: NextRequest) {
try {
@@ -69,12 +70,16 @@ export async function GET(request: NextRequest) {
}
const { searchParams } = new URL(request.url);
const path = searchParams.get('path');
const encodedPath = searchParams.get('path');
if (!path) {
if (!encodedPath) {
return NextResponse.json({ error: '缺少参数' }, { status: 400 });
}
// 对path进行base58解码
const { base58Decode } = await import('@/lib/utils');
const path = base58Decode(encodedPath);
const config = await getConfig();
const xiaoyaConfig = config.XiaoyaConfig;