mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
fix: comment out subtitles handling in getRiveStream function and add referer header
This commit is contained in:
2
dist/autoEmbed/stream.js
vendored
2
dist/autoEmbed/stream.js
vendored
File diff suppressed because one or more lines are too long
@@ -87,25 +87,28 @@ export async function getRiveStream(
|
|||||||
headers: providerContext.commonHeaders,
|
headers: providerContext.commonHeaders,
|
||||||
});
|
});
|
||||||
const subtitles: TextTracks = [];
|
const subtitles: TextTracks = [];
|
||||||
if (res.data?.data?.captions) {
|
// if (res.data?.data?.captions) {
|
||||||
res.data?.data?.captions.forEach((sub: any) => {
|
// res.data?.data?.captions.forEach((sub: any) => {
|
||||||
subtitles.push({
|
// subtitles.push({
|
||||||
language: sub?.label?.slice(0, 2) || "Und",
|
// language: sub?.label?.slice(0, 2) || "Und",
|
||||||
uri: sub?.file,
|
// uri: sub?.file,
|
||||||
title: sub?.label || "Undefined",
|
// title: sub?.label || "Undefined",
|
||||||
type: sub?.file?.endsWith(".vtt")
|
// type: sub?.file?.endsWith(".vtt")
|
||||||
? "text/vtt"
|
// ? "text/vtt"
|
||||||
: "application/x-subrip",
|
// : "application/x-subrip",
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
res.data?.data?.sources.forEach((source: any) => {
|
res.data?.data?.sources.forEach((source: any) => {
|
||||||
Streams.push({
|
Streams.push({
|
||||||
server: source?.source + "-" + source?.quality,
|
server: source?.source + "-" + source?.quality,
|
||||||
link: source?.url,
|
link: source?.url,
|
||||||
type: source?.format === "hls" ? "m3u8" : "mp4",
|
type: source?.format === "hls" ? "m3u8" : "mp4",
|
||||||
quality: source?.quality,
|
quality: source?.quality,
|
||||||
subtitles: subtitles,
|
// subtitles: subtitles,
|
||||||
|
headers: {
|
||||||
|
referer: baseUrl,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user