rename and build

This commit is contained in:
himanshu8443
2025-06-20 11:22:20 +05:30
parent 91be4f5f45
commit d28625f124
2 changed files with 0 additions and 0 deletions

72
providers/showbox/meta.ts Normal file
View File

@@ -0,0 +1,72 @@
import { Info, Link, ProviderContext } from "../types";
export const getMeta = async function ({
link,
providerContext,
}: {
link: string;
providerContext: ProviderContext;
}): Promise<Info> {
try {
const { axios, cheerio } = providerContext;
const url = link;
const res = await axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const type = url.includes("tv") ? "series" : "movie";
const imdbId = "";
const title = $(".heading-name").text();
const rating =
$(".btn-imdb")
.text()
?.match(/\d+(\.\d+)?/g)?.[0] || "";
const image =
$(".cover_follow").attr("style")?.split("url(")[1]?.split(")")[0] || "";
const synopsis = $(".description")
.text()
?.replace(/[\n\t]/g, "")
?.trim();
const febID = $(".heading-name").find("a").attr("href")?.split("/")?.pop();
const baseUrl = url.split("/").slice(0, 3).join("/");
const indexUrl = `${baseUrl}/index/share_link?id=${febID}&type=${
type === "movie" ? "1" : "2"
}`;
const indexRes = await axios.get(indexUrl);
const indexData = indexRes.data;
const febKey = indexData.data.link.split("/").pop();
const febLink = `https://www.febbox.com/file/file_share_list?share_key=${febKey}&is_html=0`;
const febRes = await axios.get(febLink);
const febData = febRes.data;
const fileList = febData?.data?.file_list;
const links: Link[] = [];
if (fileList) {
fileList.map((file: any) => {
const fileName = `${file.file_name} (${file.file_size})`;
const fileId = file.fid;
links.push({
title: fileName,
episodesLink: file.is_dir ? `${febKey}&${fileId}` : `${febKey}&`,
});
});
}
return {
title,
rating,
synopsis,
image,
imdbId,
type,
linkList: links,
};
} catch (err) {
return {
title: "",
rating: "",
synopsis: "",
image: "",
imdbId: "",
type: "",
linkList: [],
};
}
};