feat: update movie categories in catalog and add Hollywood-Movies

fix: remove episodesLink from meta data in getMeta function
fix: add unlocked cookie header in extractKmhdLink function
fix: remove episodesLink from linkList in kmMovies meta
fix: add base page worker links in topmovies stream
fix: refactor instant link handling in topmovies stream
This commit is contained in:
Himanshu
2025-12-09 11:50:40 +05:30
parent 1ed05508ab
commit 1446a9f584
10 changed files with 84 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
export const catalog = [
{
title: "Latest",
filter: "", // baseUrl se latest page fetch hoga
title: "Hollywood-Movies",
filter: "genre/hollywood-movies/", // baseUrl se latest page fetch hoga
},
{
title: "Bangali-Movies",

View File

@@ -145,7 +145,6 @@ export const getMeta = async function ({
title: fullTitle,
quality: quality.replace(/[^0-9p]/g, ""), // Clean to just 480p, 720p, 1080p
// The direct link is to a page that lists all episodes, so it acts as the episodesLink
episodesLink: directLink,
directLinks,
});
}

View File

@@ -5,7 +5,11 @@ async function extractKmhdLink(
providerContext: ProviderContext
) {
const { axios } = providerContext;
const res = await axios.get(katlink);
const res = await axios.get(katlink, {
headers: {
Cookie: "unlocked=true",
},
});
const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match(

View File

@@ -107,7 +107,6 @@ export const getMeta = async function ({
const titleText = `Download ${quality} ${size}`.trim();
linkList.push({
title: titleText,
episodesLink: href,
quality: quality || "AUTO",
directLinks: [
{
@@ -129,7 +128,6 @@ export const getMeta = async function ({
if (href) {
linkList.push({
title: titleText,
episodesLink: href,
quality,
directLinks: [
{

View File

@@ -141,6 +141,22 @@ export const getStream = async function ({
} catch (err) {
console.log("ResumeBot link not found", err);
}
// Base page worker
try {
const baseWorkerStream = $drive(".btn-success");
baseWorkerStream.each((i, el) => {
const link = (el as any).attribs?.href;
if (link) {
servers.push({
server: "Resume Worker " + (i + 1),
link: link,
type: "mkv",
});
}
});
} catch (err) {
console.log("Base page worker link not found", err);
}
// CF workers type 1
try {
const cfWorkersLink = driveLink.replace("/file", "/wfile") + "?type=1";
@@ -185,37 +201,69 @@ export const getStream = async function ({
// gdrive
//instant link
//*******
//instant link 1
//*******
// try {
// const seed = $drive(".btn-danger").attr("href") || "";
// const instantToken = seed.split("=")[1];
// console.log("InstantToken", instantToken);
// const InstantFromData = new FormData();
// InstantFromData.append("keys", instantToken);
// const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log("videoSeedUrl", videoSeedUrl);
// const instantLinkRes = await fetch(videoSeedUrl, {
// method: "POST",
// body: InstantFromData,
// headers: {
// "x-token": videoSeedUrl,
// },
// });
// const instantLinkData = await instantLinkRes.json();
// // console.log('instantLinkData', instantLinkData);
// if (instantLinkData.error === false) {
// const instantLink = instantLinkData.url;
// servers.push({
// server: "Gdrive-Instant",
// link: instantLink,
// type: "mkv",
// });
// } else {
// console.log("Instant link not found", instantLinkData);
// }
// } catch (err) {
// console.log("Instant link not found", err);
// }
//*******
//instant link 2
//*******
try {
const seed = $drive(".btn-danger").attr("href") || "";
const instantToken = seed.split("=")[1];
// console.log('InstantToken', instantToken);
const InstantFromData = new FormData();
InstantFromData.append("keys", instantToken);
const videoSeedUrl = seed.split("/").slice(0, 3).join("/") + "/api";
// console.log('videoSeedUrl', videoSeedUrl);
const instantLinkRes = await fetch(videoSeedUrl, {
method: "POST",
body: InstantFromData,
headers: {
"x-token": videoSeedUrl,
},
const newLinkRes = await fetch(seed, {
method: "HEAD",
headers,
redirect: "manual",
});
const instantLinkData = await instantLinkRes.json();
// console.log('instantLinkData', instantLinkData);
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
servers.push({
server: "Gdrive-Instant",
link: instantLink,
type: "mkv",
});
let newLink = seed;
if (newLinkRes.status >= 300 && newLinkRes.status < 400) {
newLink = newLinkRes.headers.get("location") || seed;
} else if (newLinkRes.url && newLinkRes.url !== seed) {
// Fallback: check if URL changed (redirect was followed)
newLink = newLinkRes.url || newLinkRes.url;
} else {
console.log("Instant link not found", instantLinkData);
newLink = newLinkRes.headers.get("location") || seed;
}
console.log("Gdrive-Instant-2 link", newLink?.split("?url=")[1]);
servers.push({
server: "Gdrive-Instant-2",
link: newLink?.split("?url=")[1] || newLink,
type: "mkv",
});
} catch (err) {
console.log("Instant link not found", err);
}
return servers;
} catch (err) {
console.log("getStream error", err);
@@ -257,7 +305,7 @@ async function modExtractor(url: string, providerContext: ProviderContext) {
// find input with name="_wp_http2"
const wpHttp2 = $("input").attr("name", "_wp_http2").val();
// console.log('wpHttp2', wpHttp2);
console.log("wpHttp2", wpHttp2);
// form data
var bodyFormData = new FormData();