SDLive multi-instance
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
import { NextRequest } from "next/server"
|
||||||
|
|
||||||
|
export async function GET(request: NextRequest) {
|
||||||
|
const url = new URL(request.url)
|
||||||
|
const baseUrl = `${url.protocol}//${url.host}`
|
||||||
|
const response = await fetch(`${baseUrl}/iptv/sdlive-playlist.m3u8?id=1`)
|
||||||
|
return response
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { NextRequest } from "next/server"
|
||||||
|
|
||||||
|
export async function GET(request: NextRequest) {
|
||||||
|
const url = new URL(request.url)
|
||||||
|
const baseUrl = `${url.protocol}//${url.host}`
|
||||||
|
const response = await fetch(`${baseUrl}/iptv/sdlive-playlist.m3u8?id=2`)
|
||||||
|
return response
|
||||||
|
}
|
||||||
@@ -1,7 +1,15 @@
|
|||||||
import { debugLog } from "@/utils/debugLog"
|
import { debugLog } from "@/utils/debugLog"
|
||||||
|
import { NextRequest } from "next/server"
|
||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: NextRequest) {
|
||||||
const response = await fetch('https://sdlive-1-internal.d-ho.me/playlist.m3u8')
|
const searchParams = request.nextUrl.searchParams
|
||||||
|
const id = searchParams.get('id')
|
||||||
|
|
||||||
|
if (!id || !["1", "2"].includes(id)) {
|
||||||
|
return new Response("Must be supplied with an id 1 or 2", { status: 400 })
|
||||||
|
}
|
||||||
|
|
||||||
|
const response = await fetch(`https://sdlive-${id}-internal.d-ho.me/playlist.m3u8`)
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
return new Response('Failed to fetch playlist', { status: 500 })
|
return new Response('Failed to fetch playlist', { status: 500 })
|
||||||
@@ -56,4 +64,5 @@ export async function GET(request: Request) {
|
|||||||
'Content-Type': 'application/vnd.apple.mpegurl',
|
'Content-Type': 'application/vnd.apple.mpegurl',
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user