mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
feat: add moviebox
This commit is contained in:
27
providers/movieBox/stream.ts
Normal file
27
providers/movieBox/stream.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Stream, ProviderContext, EpisodeLink } from "../types";
|
||||
|
||||
export const getStream = async function ({
|
||||
link: url,
|
||||
type,
|
||||
providerContext,
|
||||
}: {
|
||||
link: string;
|
||||
type: string;
|
||||
providerContext: ProviderContext;
|
||||
}): Promise<Stream[]> {
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const stream: Stream[] = [];
|
||||
const data = JSON.parse(url);
|
||||
stream.push({
|
||||
link: data.url,
|
||||
server: data.title || "Unknown Server",
|
||||
type: "mp4",
|
||||
});
|
||||
console.log("stream", stream);
|
||||
return stream;
|
||||
} catch (err) {
|
||||
console.log("getStream error", err);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user