This commit is contained in:
himanshu8443
2025-07-11 19:45:14 +05:30
parent 13f71510d5
commit 35f1e57a0b
139 changed files with 10578 additions and 139 deletions

View File

@@ -1 +1,63 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.genres=exports.catalog=void 0,exports.catalog=[{title:"Latest",filter:""},{title:"Netflix",filter:"/category/netflix"},{title:"Animated",filter:"/category/animated"},{title:"Amazon Prime",filter:"/category/amazon-prime"}],exports.genres=[{title:"Action",filter:"/category/action"},{title:"Crime",filter:"/category/crime"},{title:"Comedy",filter:"/category/comedy"},{title:"Drama",filter:"/category/drama"},{title:"Horror",filter:"/category/horror"},{title:"Family",filter:"/category/family"},{title:"Sci-Fi",filter:"/category/sifi"},{title:"Thriller",filter:"/category/triller"},{title:"Romance",filter:"/category/romance"},{title:"Fight",filter:"/category/fight"}];
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.genres = exports.catalog = void 0;
exports.catalog = [
{
title: "Latest",
filter: "",
},
{
title: "Netflix",
filter: "/category/netflix",
},
{
title: "Animated",
filter: "/category/animated",
},
{
title: "Amazon Prime",
filter: "/category/amazon-prime",
},
];
exports.genres = [
{
title: "Action",
filter: "/category/action",
},
{
title: "Crime",
filter: "/category/crime",
},
{
title: "Comedy",
filter: "/category/comedy",
},
{
title: "Drama",
filter: "/category/drama",
},
{
title: "Horror",
filter: "/category/horror",
},
{
title: "Family",
filter: "/category/family",
},
{
title: "Sci-Fi",
filter: "/category/sifi",
},
{
title: "Thriller",
filter: "/category/triller",
},
{
title: "Romance",
filter: "/category/romance",
},
{
title: "Fight",
filter: "/category/fight",
},
];

View File

@@ -1 +1,86 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,s)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getEpisodes=void 0,exports.extractKmhdLink=extractKmhdLink;const getEpisodes=function(t){return __awaiter(this,arguments,void 0,function*({url:t,providerContext:e}){var i;const{axios:n,cheerio:r}=e,o=[];try{if(t.includes("gdflix")){const e=null===(i=t.split("/pack"))||void 0===i?void 0:i[0],a=(yield n.get(t)).data,s=r.load(a),c=s(".list-group-item");if(null==c||c.map((t,i)=>{o.push({title:s(i).text()||"",link:e+s(i).find("a").attr("href")||""})}),o.length>0)return o}if(t.includes("/pack")){const i=yield extractKmhdEpisodes(t,e);null==i||i.forEach((e,i)=>{o.push({title:`Episode ${i+1}`,link:t.split("/pack")[0]+"/file/"+e})})}const a=(yield n.get(t,{headers:{Cookie:"_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true"}})).data,s=r.load(a),c=s(".autohyperlink");return null==c||c.map((t,e)=>{o.push({title:s(e).parent().children().remove().end().text()||"",link:s(e).attr("href")||""})}),o}catch(t){return[]}})};function extractKmhdLink(t,e){return __awaiter(this,void 0,void 0,function*(){const{axios:i}=e,n=(yield i.get(t)).data,r=n.match(/hubdrive_res:\s*"([^"]+)"/)[1];return n.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+r})}function extractKmhdEpisodes(t,e){return __awaiter(this,void 0,void 0,function*(){const{axios:i}=e;return(yield i.get(t)).data.match(/[\w]+_[a-f0-9]{8}/g)})}exports.getEpisodes=getEpisodes;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEpisodes = void 0;
exports.extractKmhdLink = extractKmhdLink;
const getEpisodes = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ url, providerContext, }) {
var _b;
const { axios, cheerio } = providerContext;
const episodesLink = [];
try {
if (url.includes("gdflix")) {
const baseUrl = (_b = url.split("/pack")) === null || _b === void 0 ? void 0 : _b[0];
const res = yield axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const links = $(".list-group-item");
links === null || links === void 0 ? void 0 : links.map((i, link) => {
episodesLink.push({
title: $(link).text() || "",
link: baseUrl + $(link).find("a").attr("href") || "",
});
});
if (episodesLink.length > 0) {
return episodesLink;
}
}
if (url.includes("/pack")) {
const epIds = yield extractKmhdEpisodes(url, providerContext);
epIds === null || epIds === void 0 ? void 0 : epIds.forEach((id, index) => {
episodesLink.push({
title: `Episode ${index + 1}`,
link: url.split("/pack")[0] + "/file/" + id,
});
});
}
const res = yield axios.get(url, {
headers: {
Cookie: "_ga_GNR438JY8N=GS1.1.1722240350.5.0.1722240350.0.0.0; _ga=GA1.1.372196696.1722150754; unlocked=true",
},
});
const episodeData = res.data;
const $ = cheerio.load(episodeData);
const links = $(".autohyperlink");
links === null || links === void 0 ? void 0 : links.map((i, link) => {
episodesLink.push({
title: $(link).parent().children().remove().end().text() || "",
link: $(link).attr("href") || "",
});
});
return episodesLink;
}
catch (err) {
console.error(err);
return [];
}
});
};
exports.getEpisodes = getEpisodes;
function extractKmhdLink(katlink, providerContext) {
return __awaiter(this, void 0, void 0, function* () {
const { axios } = providerContext;
const res = yield axios.get(katlink);
const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1];
return hubDriveLink + hubDriveRes;
});
}
function extractKmhdEpisodes(katlink, providerContext) {
return __awaiter(this, void 0, void 0, function* () {
const { axios } = providerContext;
const res = yield axios.get(katlink);
const data = res.data;
const ids = data.match(/[\w]+_[a-f0-9]{8}/g);
return ids;
});
}

129
dist/katmovies/meta.js vendored
View File

@@ -1 +1,128 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,a){function r(t){try{d(n.next(t))}catch(t){a(t)}}function s(t){try{d(n.throw(t))}catch(t){a(t)}}function d(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(r,s)}d((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const getMeta=function(t){return __awaiter(this,arguments,void 0,function*({link:t,providerContext:e}){var i;try{const{axios:n,cheerio:o}=e,a=t,r=(yield n.get(a)).data,s=o.load(r),d=s(".yQ8hqd.ksSzJd.LoQAYe").html()?s(".yQ8hqd.ksSzJd.LoQAYe"):s(".FxvUNb"),c=(null===(i=d.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])').attr("href"))||void 0===i?void 0:i.split("/")[4])||"",l=d.find('li:contains("Name")').children().remove().end().text(),h=s(".yQ8hqd.ksSzJd.LoQAYe").html()?"series":"movie",p=d.find('li:contains("Stars")').text(),f=s('h4:contains("SCREENSHOTS")').next().find("img").attr("src")||"",u=[],v=[];return s(".entry-content").find('p:contains("Episode")').each((e,i)=>{const n=s(i).nextAll("h3,h2").first().find('a:contains("1080"),a:contains("720"),a:contains("480")').attr("href")||"",o=s(i).find("span").text();t.trim().length>0&&o.includes("Episode ")&&v.push({title:o,link:n})}),v.length>0&&u.push({quality:"",title:l,directLinks:v}),s(".entry-content").find("pre").nextUntil("div").filter("h2").each((t,e)=>{var i;const n=s(e).find("a").attr("href"),o=(null===(i=s(e).text().match(/\b(480p|720p|1080p|2160p)\b/i))||void 0===i?void 0:i[0])||"",a=s(e).text();n&&a.includes("")&&u.push({quality:o,title:a,episodesLink:n})}),0===u.length&&"movie"===h&&s(".entry-content").find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")').nextUntil("pre,div").filter("h2").each((t,e)=>{var i;const n=s(e).find("a").attr("href"),o=(null===(i=s(e).text().match(/\b(480p|720p|1080p|2160p)\b/i))||void 0===i?void 0:i[0])||"",a=s(e).text();n&&!a.includes("Online")&&u.push({quality:o,title:a,directLinks:[{link:n,title:a,type:"movie"}]})}),{title:l,synopsis:p,image:f,imdbId:c,type:h,linkList:u}}catch(t){return{title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]}}})};exports.getMeta=getMeta;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMeta = void 0;
const getMeta = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link, providerContext, }) {
var _b;
try {
const { axios, cheerio } = providerContext;
const url = link;
const res = yield axios.get(url);
const data = res.data;
const $ = cheerio.load(data);
const container = $(".yQ8hqd.ksSzJd.LoQAYe").html()
? $(".yQ8hqd.ksSzJd.LoQAYe")
: $(".FxvUNb");
const imdbId = ((_b = container
.find('a[href*="imdb.com/title/tt"]:not([href*="imdb.com/title/tt/"])')
.attr("href")) === null || _b === void 0 ? void 0 : _b.split("/")[4]) || "";
const title = container
.find('li:contains("Name")')
.children()
.remove()
.end()
.text();
const type = $(".yQ8hqd.ksSzJd.LoQAYe").html() ? "series" : "movie";
const synopsis = container.find('li:contains("Stars")').text();
const image = $('h4:contains("SCREENSHOTS")').next().find("img").attr("src") || "";
console.log("katGetInfo", title, synopsis, image, imdbId, type);
// Links
const links = [];
const directLink = [];
// direct links
$(".entry-content")
.find('p:contains("Episode")')
.each((i, element) => {
const dlLink = $(element)
.nextAll("h3,h2")
.first()
.find('a:contains("1080"),a:contains("720"),a:contains("480")')
.attr("href") || "";
const dlTitle = $(element).find("span").text();
if (link.trim().length > 0 && dlTitle.includes("Episode ")) {
directLink.push({
title: dlTitle,
link: dlLink,
});
}
});
if (directLink.length > 0) {
links.push({
quality: "",
title: title,
directLinks: directLink,
});
}
$(".entry-content")
.find("pre")
.nextUntil("div")
.filter("h2")
.each((i, element) => {
var _a;
const link = $(element).find("a").attr("href");
const quality = ((_a = $(element)
.text()
.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || "";
const title = $(element).text();
if (link && title.includes("")) {
links.push({
quality,
title,
episodesLink: link,
});
}
});
if (links.length === 0 && type === "movie") {
$(".entry-content")
.find('h2:contains("DOWNLOAD"),h3:contains("DOWNLOAD")')
.nextUntil("pre,div")
.filter("h2")
.each((i, element) => {
var _a;
const link = $(element).find("a").attr("href");
const quality = ((_a = $(element)
.text()
.match(/\b(480p|720p|1080p|2160p)\b/i)) === null || _a === void 0 ? void 0 : _a[0]) || "";
const title = $(element).text();
if (link && !title.includes("Online")) {
links.push({
quality,
title,
directLinks: [{ link, title, type: "movie" }],
});
}
});
}
// console.log('drive meta', title, synopsis, image, imdbId, type, links);
return {
title,
synopsis,
image,
imdbId,
type,
linkList: links,
};
}
catch (err) {
console.error(err);
return {
title: "",
synopsis: "",
image: "",
imdbId: "",
type: "movie",
linkList: [],
};
}
});
};
exports.getMeta = getMeta;

View File

@@ -1 +1,59 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{c(n.next(t))}catch(t){o(t)}}function a(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(s,a)}c((n=n.apply(t,e||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getSearchPosts=exports.getPosts=void 0;const getPosts=function(t){return __awaiter(this,arguments,void 0,function*({filter:t,page:e,signal:r,providerContext:n}){const{getBaseUrl:i,cheerio:o}=n;return posts({url:`${(yield i("kat"))+t}/page/${e}/`,signal:r,cheerio:o})})};exports.getPosts=getPosts;const getSearchPosts=function(t){return __awaiter(this,arguments,void 0,function*({searchQuery:t,page:e,signal:r,providerContext:n}){const{getBaseUrl:i,cheerio:o}=n;return posts({url:`${yield i("kat")}/page/${e}/?s=${t}`,signal:r,cheerio:o})})};function posts(t){return __awaiter(this,arguments,void 0,function*({url:t,signal:e,cheerio:r}){try{const n=yield fetch(t,{signal:e}),i=yield n.text(),o=r.load(i),s=[];return o(".recent-posts").children().map((t,e)=>{const r=o(e).find("img").attr("alt"),n=o(e).find("a").attr("href"),i=o(e).find("img").attr("src");r&&n&&i&&s.push({title:r.replace("Download","").trim(),link:n,image:i})}),s}catch(t){return[]}})}exports.getSearchPosts=getSearchPosts;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSearchPosts = exports.getPosts = void 0;
const getPosts = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ filter, page, signal, providerContext, }) {
const { getBaseUrl, cheerio } = providerContext;
const baseUrl = yield getBaseUrl("kat");
const url = `${baseUrl + filter}/page/${page}/`;
return posts({ url, signal, cheerio });
});
};
exports.getPosts = getPosts;
const getSearchPosts = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ searchQuery, page, signal, providerContext, }) {
const { getBaseUrl, cheerio } = providerContext;
const baseUrl = yield getBaseUrl("kat");
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
return posts({ url, signal, cheerio });
});
};
exports.getSearchPosts = getSearchPosts;
function posts(_a) {
return __awaiter(this, arguments, void 0, function* ({ url, signal, cheerio, }) {
try {
const res = yield fetch(url, { signal });
const data = yield res.text();
const $ = cheerio.load(data);
const catalog = [];
$(".recent-posts")
.children()
.map((i, element) => {
const title = $(element).find("img").attr("alt");
const link = $(element).find("a").attr("href");
const image = $(element).find("img").attr("src");
if (title && link && image) {
catalog.push({
title: title.replace("Download", "").trim(),
link: link,
image: image,
});
}
});
return catalog;
}
catch (err) {
console.error("katmovies error ", err);
return [];
}
});
}

View File

@@ -1 +1,104 @@
"use strict";var __awaiter=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))(function(n,a){function o(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(o,s)}c((i=i.apply(t,e||[])).next())})};function extractKmhdLink(t,e){return __awaiter(this,void 0,void 0,function*(){const{axios:r}=e,i=(yield r.get(t)).data,n=i.match(/hubdrive_res:\s*"([^"]+)"/)[1];return i.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+n})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(t){return __awaiter(this,arguments,void 0,function*({link:t,signal:e,providerContext:r}){const{axios:i,cheerio:n,extractors:a}=r,{hubcloudExtracter:o,gdFlixExtracter:s}=a,c=[];try{if(t.includes("gdflix"))return yield s(t,e);if(t.includes("kmhd")){const i=yield extractKmhdLink(t,r);return yield o(i,e)}if(t.includes("gdflix")){try{const e=t.replace("/file","/zfile"),r=(yield i.get(e)).data,a=n.load(r)(".btn-success").attr("href");a&&c.push({server:"ResumeCloud",link:a,type:"mkv"})}catch(t){}try{const e=yield i.get(t,{timeout:1e4}),r=n.load(e.data)(".btn-danger").attr("href")||"",a=r.split("=")[1],o=new FormData;o.append("keys",a);const s=r.split("/").slice(0,3).join("/")+"/api",d=yield fetch(s,{method:"POST",body:o,headers:{"x-token":s}}),u=yield d.json();if(!1===u.error){const t=u.url;c.push({server:"Gdrive-Instant",link:t,type:"mkv"})}}catch(t){}return c}return yield o(t,e)}catch(t){return[]}})};exports.getStream=getStream;
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStream = void 0;
function extractKmhdLink(katlink, providerContext) {
return __awaiter(this, void 0, void 0, function* () {
const { axios } = providerContext;
const res = yield axios.get(katlink);
const data = res.data;
const hubDriveRes = data.match(/hubdrive_res:\s*"([^"]+)"/)[1];
const hubDriveLink = data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1];
return hubDriveLink + hubDriveRes;
});
}
const getStream = function (_a) {
return __awaiter(this, arguments, void 0, function* ({ link, signal, providerContext, }) {
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter, gdFlixExtracter } = extractors;
const streamLinks = [];
console.log("katGetStream", link);
try {
if (link.includes("gdflix")) {
return yield gdFlixExtracter(link, signal);
}
if (link.includes("kmhd")) {
const hubcloudLink = yield extractKmhdLink(link, providerContext);
return yield hubcloudExtracter(hubcloudLink, signal);
}
if (link.includes("gdflix")) {
// resume link
try {
const resumeDrive = link.replace("/file", "/zfile");
// console.log('resumeDrive', resumeDrive);
const resumeDriveRes = yield axios.get(resumeDrive);
const resumeDriveHtml = resumeDriveRes.data;
const $resumeDrive = cheerio.load(resumeDriveHtml);
const resumeLink = $resumeDrive(".btn-success").attr("href");
console.log("resumeLink", resumeLink);
if (resumeLink) {
streamLinks.push({
server: "ResumeCloud",
link: resumeLink,
type: "mkv",
});
}
}
catch (err) {
console.log("Resume link not found");
}
//instant link
try {
const driveres = yield axios.get(link, { timeout: 10000 });
const $drive = cheerio.load(driveres.data);
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 = yield fetch(videoSeedUrl, {
method: "POST",
body: InstantFromData,
headers: {
"x-token": videoSeedUrl,
},
});
const instantLinkData = yield instantLinkRes.json();
console.log("instantLinkData", instantLinkData);
if (instantLinkData.error === false) {
const instantLink = instantLinkData.url;
streamLinks.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);
}
return streamLinks;
}
const stereams = yield hubcloudExtracter(link, signal);
return stereams;
}
catch (error) {
console.log("katgetStream error: ", error);
return [];
}
});
};
exports.getStream = getStream;