mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
Add MoviezWap provider and update manifest (#1)
Co-authored-by: shaker <your_github_username@users.noreply.github.com> Co-authored-by: himanshu8443 <sangwanhimanshu8443@gmail.com>
This commit is contained in:
34
providers/moviezwap/stream.ts
Normal file
34
providers/moviezwap/stream.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { ProviderContext, Stream } from "../types";
|
||||
|
||||
export async function getStream({
|
||||
link,
|
||||
signal,
|
||||
providerContext,
|
||||
}: {
|
||||
link: string;
|
||||
type: string;
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}) {
|
||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||
const res = await axios.get(link, { headers, signal });
|
||||
const html = res.data;
|
||||
const $ = cheerio.load(html);
|
||||
const Streams: Stream[] = [];
|
||||
|
||||
// Find the actual .mp4 download link
|
||||
let downloadLink = null;
|
||||
$('a:contains("Fast Download Server")').each((i, el) => {
|
||||
const href = $(el).attr("href");
|
||||
if (href && href.toLocaleLowerCase().includes(".mp4")) {
|
||||
Streams.push({
|
||||
link: href,
|
||||
type: "mp4",
|
||||
server: "Fast Download",
|
||||
headers: headers,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return Streams;
|
||||
}
|
||||
Reference in New Issue
Block a user