mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
build
This commit is contained in:
42
dist/kissKh/stream.js
vendored
42
dist/kissKh/stream.js
vendored
@@ -1,42 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getStream = void 0;
|
||||
const types_1 = require("../types");
|
||||
const getStream = async function ({ link: id, providerContext, }) {
|
||||
try {
|
||||
const { axios, getBaseUrl } = providerContext;
|
||||
const streamLinks = [];
|
||||
const subtitles = [];
|
||||
const baseUrl = await getBaseUrl("kissKh");
|
||||
const streamUrl = "https://adorable-salamander-ecbb21.netlify.app/api/kisskh/video?id=" +
|
||||
id;
|
||||
const res = await axios.get(streamUrl);
|
||||
const stream = res.data?.source?.Video;
|
||||
const subData = res.data?.subtitles;
|
||||
subData?.map((sub) => {
|
||||
subtitles.push({
|
||||
title: sub?.label,
|
||||
language: sub?.land,
|
||||
type: sub?.src?.includes(".vtt")
|
||||
? types_1.TextTrackType.VTT
|
||||
: types_1.TextTrackType.SUBRIP,
|
||||
uri: sub?.src,
|
||||
});
|
||||
});
|
||||
streamLinks.push({
|
||||
server: "kissKh",
|
||||
link: stream,
|
||||
type: "m3u8",
|
||||
subtitles,
|
||||
headers: {
|
||||
referer: baseUrl,
|
||||
},
|
||||
});
|
||||
return streamLinks;
|
||||
}
|
||||
catch (err) {
|
||||
console.error(err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
exports.getStream = getStream;
|
||||
Reference in New Issue
Block a user