tvbox兼容emby

This commit is contained in:
mtvpls
2026-01-03 22:21:08 +08:00
parent 6d046aea0a
commit ba8528c12e
8 changed files with 200 additions and 21 deletions
+21 -1
View File
@@ -71,6 +71,13 @@ export async function GET(request: NextRequest) {
config.OpenListConfig?.Password
);
// 检查是否配置了 Emby
const hasEmby = !!(
config.EmbyConfig?.Enabled &&
config.EmbyConfig?.ServerURL &&
(config.EmbyConfig?.ApiKey || (config.EmbyConfig?.Username && config.EmbyConfig?.Password))
);
// 构建 OpenList 站点配置
const openlistSites = hasOpenList ? [{
key: 'openlist',
@@ -83,6 +90,18 @@ export async function GET(request: NextRequest) {
ext: '',
}] : [];
// 构建 Emby 站点配置
const embySites = hasEmby ? [{
key: 'emby',
name: 'Emby媒体库',
type: 1,
api: `${baseUrl}/api/emby/cms-proxy/${encodeURIComponent(subscribeToken)}`,
searchable: 1,
quickSearch: 1,
filterable: 1,
ext: '',
}] : [];
// 构建TVBOX订阅数据
const tvboxSubscription = {
// 站点配置
@@ -90,9 +109,10 @@ export async function GET(request: NextRequest) {
wallpaper: '',
// 视频源站点 - 根据 adFilter 参数决定是否使用代理
// OpenList 源放在最前面
// OpenList 和 Emby 源放在最前面
sites: [
...openlistSites,
...embySites,
...apiSites.map(site => ({
key: site.key,
name: site.name,