feat: 智能判断影视源类型,根据API地址动态设置type
This commit is contained in:
+19
-14
@@ -69,20 +69,25 @@ export async function GET(request: NextRequest) {
|
|||||||
wallpaper: `${baseUrl}/screenshot1.png`, // 使用项目截图作为壁纸
|
wallpaper: `${baseUrl}/screenshot1.png`, // 使用项目截图作为壁纸
|
||||||
|
|
||||||
// 影视源配置
|
// 影视源配置
|
||||||
sites: sourceConfigs.map((source) => ({
|
sites: sourceConfigs.map((source) => {
|
||||||
key: source.key || source.name,
|
// 智能判断type:如果api地址以.json结尾,则type为1,否则为0
|
||||||
name: source.name,
|
const type = source.api.toLowerCase().endsWith('.json') ? 1 : 0;
|
||||||
type: 0, // 影视源
|
|
||||||
api: source.api,
|
return {
|
||||||
searchable: 1, // 可搜索
|
key: source.key || source.name,
|
||||||
quickSearch: 1, // 支持快速搜索
|
name: source.name,
|
||||||
filterable: 1, // 支持分类筛选
|
type: type, // 使用智能判断的type
|
||||||
ext: source.detail || '', // 详情页地址作为扩展参数
|
api: source.api,
|
||||||
timeout: 30, // 30秒超时
|
searchable: 1, // 可搜索
|
||||||
categories: [
|
quickSearch: 1, // 支持快速搜索
|
||||||
"电影", "电视剧", "综艺", "动漫", "纪录片", "短剧"
|
filterable: 1, // 支持分类筛选
|
||||||
]
|
ext: source.detail || '', // 详情页地址作为扩展参数
|
||||||
})),
|
timeout: 30, // 30秒超时
|
||||||
|
categories: [
|
||||||
|
"电影", "电视剧", "综艺", "动漫", "纪录片", "短剧"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}),
|
||||||
|
|
||||||
// 解析源配置(添加一些常用的解析源)
|
// 解析源配置(添加一些常用的解析源)
|
||||||
parses: [
|
parses: [
|
||||||
|
|||||||
Reference in New Issue
Block a user