tvbox黄色过滤
This commit is contained in:
@@ -28,6 +28,7 @@ export async function GET(request: NextRequest) {
|
||||
const token = searchParams.get('token');
|
||||
const globalToken = process.env.TVBOX_SUBSCRIBE_TOKEN;
|
||||
const adFilter = searchParams.get('adFilter') === 'true'; // 获取去广告参数
|
||||
const yellowFilter = searchParams.get('yellowFilter') === 'true';
|
||||
|
||||
if (!token) {
|
||||
return NextResponse.json(
|
||||
@@ -89,7 +90,7 @@ export async function GET(request: NextRequest) {
|
||||
baseUrl = `${proto}://${host}`;
|
||||
}
|
||||
|
||||
console.log('TVBOX 订阅 baseUrl:', baseUrl, 'adFilter:', adFilter);
|
||||
console.log('TVBOX 订阅 baseUrl:', baseUrl, 'adFilter:', adFilter, 'yellowFilter:', yellowFilter);
|
||||
|
||||
// 检查是否配置了 OpenList
|
||||
const hasOpenList = !!(
|
||||
@@ -142,9 +143,9 @@ export async function GET(request: NextRequest) {
|
||||
key: site.key,
|
||||
name: site.name,
|
||||
type: 1,
|
||||
// 如果开启去广告,使用 CMS 代理;否则使用原始 API
|
||||
api: adFilter
|
||||
? `${baseUrl}/api/cms-proxy?api=${encodeURIComponent(site.api)}`
|
||||
// 开启去广告或黄色过滤时使用 CMS 代理
|
||||
api: (adFilter || yellowFilter)
|
||||
? `${baseUrl}/api/cms-proxy?api=${encodeURIComponent(site.api)}${adFilter ? '&adFilter=true' : ''}${yellowFilter ? '&yellowFilter=true' : ''}`
|
||||
: site.api,
|
||||
searchable: 1,
|
||||
quickSearch: 1,
|
||||
|
||||
Reference in New Issue
Block a user