mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 15:41:45 +00:00
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:
2
dist/Joya9tv/catalog.js
vendored
2
dist/Joya9tv/catalog.js
vendored
@@ -1 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.catalog=void 0,exports.catalog=[{title:"Latest",filter:""},{title:"Bangali-Movies",filter:"genre/bengali-movies/"}];
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.catalog=void 0,exports.catalog=[{title:"Hollywood-Movies",filter:"genre/hollywood-movies/"},{title:"Bangali-Movies",filter:"genre/bengali-movies/"}];
|
||||
2
dist/Joya9tv/meta.js
vendored
2
dist/Joya9tv/meta.js
vendored
@@ -1 +1 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","Cache-Control":"no-store","Accept-Language":"en-US,en;q=0.9",DNT:"1","sec-ch-ua":'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"none","Sec-Fetch-User":"?1",Cookie:"xla=s4t; _ga=GA1.1.1081149560.1756378968; _ga_BLZGKYN5PF=GS2.1.s1756378968$o1$g1$t1756378984$j44$l0$h0","Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"},getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b;const{cheerio:cheerio}=providerContext,url=link,baseUrl=url.split("/").slice(0,3).join("/"),emptyResult={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]};try{const response=yield fetch(url,{headers:Object.assign(Object.assign({},headers),{Referer:baseUrl})}),data=yield response.text(),$=cheerio.load(data),infoContainer=$(".content.right").first(),result={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]};/S\d+|Season \d+|TV Series\/Shows/i.test(infoContainer.find("h1").text()+$(".sgeneros").text())?result.type="series":result.type="movie";const rawTitle=$("h1").first().text().trim();let finalTitle=rawTitle.replace(/ Download.*|\[Episode \d+ Added\]/g,"").trim();finalTitle=finalTitle.split(/\(2025\)| S\d+/i)[0].trim()||"Unknown Title",result.title=finalTitle;const imdbMatch=null===(_b=infoContainer.html())||void 0===_b?void 0:_b.match(/tt\d+/);result.imdbId=imdbMatch?imdbMatch[0]:"";let image=infoContainer.find(".poster img[src]").first().attr("src")||"";image.startsWith("//")&&(image="https:"+image),(image.includes("no-thumbnail")||image.includes("placeholder"))&&(image=""),result.image=image,result.synopsis=$("#info .wp-content").text().trim()||"";const links=[];return $("#download .links_table table tbody").find("tr").each((index,element)=>{var _a;const row=$(element),quality=row.find("strong.quality").text().trim(),size=row.find("td:nth-child(4)").text().trim(),directLinkAnchor=row.find("td a").first(),directLink=directLinkAnchor.attr("href"),linkTitle=directLinkAnchor.text().trim();if(quality&&directLink){const directLinks=[{title:linkTitle||"Download Link",link:directLink,type:result.type}],seasonMatch=null===(_a=rawTitle.match(/S(\d+)/))||void 0===_a?void 0:_a[1];let fullTitle=`${result.title}`;seasonMatch&&(fullTitle+=` Season ${seasonMatch}`),fullTitle+=` - ${quality}`,size&&(fullTitle+=` (${size})`),links.push({title:fullTitle,quality:quality.replace(/[^0-9p]/g,""),episodesLink:directLink,directLinks:directLinks})}}),result.linkList=links,result}catch(err){return emptyResult}})};exports.getMeta=getMeta;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7","Cache-Control":"no-store","Accept-Language":"en-US,en;q=0.9",DNT:"1","sec-ch-ua":'"Not_A Brand";v="8", "Chromium";v="120", "Microsoft Edge";v="120"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"Windows"',"Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Sec-Fetch-Site":"none","Sec-Fetch-User":"?1",Cookie:"xla=s4t; _ga=GA1.1.1081149560.1756378968; _ga_BLZGKYN5PF=GS2.1.s1756378968$o1$g1$t1756378984$j44$l0$h0","Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"},getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b;const{cheerio:cheerio}=providerContext,url=link,baseUrl=url.split("/").slice(0,3).join("/"),emptyResult={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]};try{const response=yield fetch(url,{headers:Object.assign(Object.assign({},headers),{Referer:baseUrl})}),data=yield response.text(),$=cheerio.load(data),infoContainer=$(".content.right").first(),result={title:"",synopsis:"",image:"",imdbId:"",type:"movie",linkList:[]};/S\d+|Season \d+|TV Series\/Shows/i.test(infoContainer.find("h1").text()+$(".sgeneros").text())?result.type="series":result.type="movie";const rawTitle=$("h1").first().text().trim();let finalTitle=rawTitle.replace(/ Download.*|\[Episode \d+ Added\]/g,"").trim();finalTitle=finalTitle.split(/\(2025\)| S\d+/i)[0].trim()||"Unknown Title",result.title=finalTitle;const imdbMatch=null===(_b=infoContainer.html())||void 0===_b?void 0:_b.match(/tt\d+/);result.imdbId=imdbMatch?imdbMatch[0]:"";let image=infoContainer.find(".poster img[src]").first().attr("src")||"";image.startsWith("//")&&(image="https:"+image),(image.includes("no-thumbnail")||image.includes("placeholder"))&&(image=""),result.image=image,result.synopsis=$("#info .wp-content").text().trim()||"";const links=[];return $("#download .links_table table tbody").find("tr").each((index,element)=>{var _a;const row=$(element),quality=row.find("strong.quality").text().trim(),size=row.find("td:nth-child(4)").text().trim(),directLinkAnchor=row.find("td a").first(),directLink=directLinkAnchor.attr("href"),linkTitle=directLinkAnchor.text().trim();if(quality&&directLink){const directLinks=[{title:linkTitle||"Download Link",link:directLink,type:result.type}],seasonMatch=null===(_a=rawTitle.match(/S(\d+)/))||void 0===_a?void 0:_a[1];let fullTitle=`${result.title}`;seasonMatch&&(fullTitle+=` Season ${seasonMatch}`),fullTitle+=` - ${quality}`,size&&(fullTitle+=` (${size})`),links.push({title:fullTitle,quality:quality.replace(/[^0-9p]/g,""),directLinks:directLinks})}}),result.linkList=links,result}catch(err){return emptyResult}})};exports.getMeta=getMeta;
|
||||
2
dist/katmovies/stream.js
vendored
2
dist/katmovies/stream.js
vendored
@@ -1 +1 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};function extractKmhdLink(katlink,providerContext){return __awaiter(this,void 0,void 0,function*(){const{axios:axios}=providerContext,data=(yield axios.get(katlink)).data,hubDriveRes=data.match(/hubdrive_res:\s*"([^"]+)"/)[1];return data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+hubDriveRes})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,signal:signal,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,extractors:extractors}=providerContext,{hubcloudExtracter:hubcloudExtracter,gdFlixExtracter:gdFlixExtracter}=extractors,streamLinks=[];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")){try{const resumeDrive=link.replace("/file","/zfile"),resumeDriveHtml=(yield axios.get(resumeDrive)).data,resumeLink=cheerio.load(resumeDriveHtml)(".btn-success").attr("href");resumeLink&&streamLinks.push({server:"ResumeCloud",link:resumeLink,type:"mkv"})}catch(err){}try{const driveres=yield axios.get(link,{timeout:1e4}),seed=cheerio.load(driveres.data)(".btn-danger").attr("href")||"",instantToken=seed.split("=")[1],InstantFromData=new FormData;InstantFromData.append("keys",instantToken);const videoSeedUrl=seed.split("/").slice(0,3).join("/")+"/api",instantLinkRes=yield fetch(videoSeedUrl,{method:"POST",body:InstantFromData,headers:{"x-token":videoSeedUrl}}),instantLinkData=yield instantLinkRes.json();if(!1===instantLinkData.error){const instantLink=instantLinkData.url;streamLinks.push({server:"Gdrive-Instant",link:instantLink,type:"mkv"})}}catch(err){}return streamLinks}return yield hubcloudExtracter(link,signal)}catch(error){return[]}})};exports.getStream=getStream;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};function extractKmhdLink(katlink,providerContext){return __awaiter(this,void 0,void 0,function*(){const{axios:axios}=providerContext,data=(yield axios.get(katlink,{headers:{Cookie:"unlocked=true"}})).data,hubDriveRes=data.match(/hubdrive_res:\s*"([^"]+)"/)[1];return data.match(/hubdrive_res\s*:\s*{[^}]*?link\s*:\s*"([^"]+)"/)[1]+hubDriveRes})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getStream=void 0;const getStream=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,signal:signal,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,extractors:extractors}=providerContext,{hubcloudExtracter:hubcloudExtracter,gdFlixExtracter:gdFlixExtracter}=extractors,streamLinks=[];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")){try{const resumeDrive=link.replace("/file","/zfile"),resumeDriveHtml=(yield axios.get(resumeDrive)).data,resumeLink=cheerio.load(resumeDriveHtml)(".btn-success").attr("href");resumeLink&&streamLinks.push({server:"ResumeCloud",link:resumeLink,type:"mkv"})}catch(err){}try{const driveres=yield axios.get(link,{timeout:1e4}),seed=cheerio.load(driveres.data)(".btn-danger").attr("href")||"",instantToken=seed.split("=")[1],InstantFromData=new FormData;InstantFromData.append("keys",instantToken);const videoSeedUrl=seed.split("/").slice(0,3).join("/")+"/api",instantLinkRes=yield fetch(videoSeedUrl,{method:"POST",body:InstantFromData,headers:{"x-token":videoSeedUrl}}),instantLinkData=yield instantLinkRes.json();if(!1===instantLinkData.error){const instantLink=instantLinkData.url;streamLinks.push({server:"Gdrive-Instant",link:instantLink,type:"mkv"})}}catch(err){}return streamLinks}return yield hubcloudExtracter(link,signal)}catch(error){return[]}})};exports.getStream=getStream;
|
||||
2
dist/kmMovies/meta.js
vendored
2
dist/kmMovies/meta.js
vendored
@@ -1 +1 @@
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const kmmHeaders={Referer:"https://google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"},getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c;try{const{axios:axios,cheerio:cheerio}=providerContext;if(!link.startsWith("http")){link=`${yield providerContext.getBaseUrl("kmmovies")}${link.startsWith("/")?"":"/"}${link}`}const res=yield axios.get(link,{headers:kmmHeaders}),$=cheerio.load(res.data),title=$("h1, h2, .animated-text").first().text().trim()||(null===(_b=$("meta[property='og:title']").attr("content"))||void 0===_b?void 0:_b.trim())||$("title").text().trim()||"Unknown";let image=$("div.wp-slider-container img").first().attr("src")||$("meta[property='og:image']").attr("content")||$("meta[name='twitter:image']").attr("content")||"";image&&image.startsWith("http")||(image=new URL(image||"/placeholder.png",link).href);let synopsis="";$("p").each((_,el)=>{const text=$(el).text().trim();if(text&&text.length>40&&!text.toLowerCase().includes("download")&&!text.toLowerCase().includes("quality"))return synopsis=text,!1}),synopsis||(synopsis=$("meta[property='og:description']").attr("content")||$("meta[name='description']").attr("content")||"");const tags=[];res.data.toLowerCase().includes("action")&&tags.push("Action"),res.data.toLowerCase().includes("drama")&&tags.push("Drama"),res.data.toLowerCase().includes("romance")&&tags.push("Romance"),res.data.toLowerCase().includes("thriller")&&tags.push("Thriller");const cast=[];$("p").each((_,el)=>{const text=$(el).text().trim();/starring|cast/i.test(text)&&text.split(",").forEach(name=>cast.push(name.trim()))});let rating=(null===(_c=$("p").text().match(/IMDb Rating[:\s]*([0-9.]+)/i))||void 0===_c?void 0:_c[1])||"";rating&&!rating.includes("/")&&(rating+="/10");const imdbLink=$("p a[href*='imdb.com']").attr("href")||"",imdbId=imdbLink&&imdbLink.includes("/tt")?"tt"+imdbLink.split("/tt")[1].split("/")[0]:"",linkList=[],isSeries=$(".download-options-grid").length>0;return isSeries?$(".download-card").each((_,card)=>{const card$=$(card),quality=card$.find(".download-quality-text").text().trim(),size=card$.find(".download-size-info").text().trim()||"",href=card$.find("a.tabs-download-button").attr("href")||"";if(href){const titleText=`Download ${quality} ${size}`.trim();linkList.push({title:titleText,episodesLink:href,quality:quality||"AUTO",directLinks:[{link:href,title:titleText,type:"series"}]})}}):$("a.modern-download-button").each((_,a)=>{const quality=$(a).closest(".modern-option-card").find(".modern-badge").text().trim()||"AUTO",href=$(a).attr("href")||"",titleText=`Download ${quality}`;href&&linkList.push({title:titleText,episodesLink:href,quality:quality,directLinks:[{link:href,title:titleText,type:"movie"}]})}),{title:title,synopsis:synopsis,image:image,imdbId:imdbId,type:isSeries?"series":"movie",tags:tags,cast:cast,rating:rating,linkList:linkList}}catch(err){return{title:"",synopsis:"",image:"https://via.placeholder.com/300x450",imdbId:"",type:"movie",tags:[],cast:[],rating:"",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
"use strict";var __awaiter=this&&this.__awaiter||function(thisArg,_arguments,P,generator){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){var value;result.done?resolve(result.value):(value=result.value,value instanceof P?value:new P(function(resolve){resolve(value)})).then(fulfilled,rejected)}step((generator=generator.apply(thisArg,_arguments||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.getMeta=void 0;const kmmHeaders={Referer:"https://google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"},getMeta=function(_a){return __awaiter(this,arguments,void 0,function*({link:link,providerContext:providerContext}){var _b,_c;try{const{axios:axios,cheerio:cheerio}=providerContext;if(!link.startsWith("http")){link=`${yield providerContext.getBaseUrl("kmmovies")}${link.startsWith("/")?"":"/"}${link}`}const res=yield axios.get(link,{headers:kmmHeaders}),$=cheerio.load(res.data),title=$("h1, h2, .animated-text").first().text().trim()||(null===(_b=$("meta[property='og:title']").attr("content"))||void 0===_b?void 0:_b.trim())||$("title").text().trim()||"Unknown";let image=$("div.wp-slider-container img").first().attr("src")||$("meta[property='og:image']").attr("content")||$("meta[name='twitter:image']").attr("content")||"";image&&image.startsWith("http")||(image=new URL(image||"/placeholder.png",link).href);let synopsis="";$("p").each((_,el)=>{const text=$(el).text().trim();if(text&&text.length>40&&!text.toLowerCase().includes("download")&&!text.toLowerCase().includes("quality"))return synopsis=text,!1}),synopsis||(synopsis=$("meta[property='og:description']").attr("content")||$("meta[name='description']").attr("content")||"");const tags=[];res.data.toLowerCase().includes("action")&&tags.push("Action"),res.data.toLowerCase().includes("drama")&&tags.push("Drama"),res.data.toLowerCase().includes("romance")&&tags.push("Romance"),res.data.toLowerCase().includes("thriller")&&tags.push("Thriller");const cast=[];$("p").each((_,el)=>{const text=$(el).text().trim();/starring|cast/i.test(text)&&text.split(",").forEach(name=>cast.push(name.trim()))});let rating=(null===(_c=$("p").text().match(/IMDb Rating[:\s]*([0-9.]+)/i))||void 0===_c?void 0:_c[1])||"";rating&&!rating.includes("/")&&(rating+="/10");const imdbLink=$("p a[href*='imdb.com']").attr("href")||"",imdbId=imdbLink&&imdbLink.includes("/tt")?"tt"+imdbLink.split("/tt")[1].split("/")[0]:"",linkList=[],isSeries=$(".download-options-grid").length>0;return isSeries?$(".download-card").each((_,card)=>{const card$=$(card),quality=card$.find(".download-quality-text").text().trim(),size=card$.find(".download-size-info").text().trim()||"",href=card$.find("a.tabs-download-button").attr("href")||"";if(href){const titleText=`Download ${quality} ${size}`.trim();linkList.push({title:titleText,quality:quality||"AUTO",directLinks:[{link:href,title:titleText,type:"series"}]})}}):$("a.modern-download-button").each((_,a)=>{const quality=$(a).closest(".modern-option-card").find(".modern-badge").text().trim()||"AUTO",href=$(a).attr("href")||"",titleText=`Download ${quality}`;href&&linkList.push({title:titleText,quality:quality,directLinks:[{link:href,title:titleText,type:"movie"}]})}),{title:title,synopsis:synopsis,image:image,imdbId:imdbId,type:isSeries?"series":"movie",tags:tags,cast:cast,rating:rating,linkList:linkList}}catch(err){return{title:"",synopsis:"",image:"https://via.placeholder.com/300x450",imdbId:"",type:"movie",tags:[],cast:[],rating:"",linkList:[]}}})};exports.getMeta=getMeta;
|
||||
2
dist/topmovies/stream.js
vendored
2
dist/topmovies/stream.js
vendored
File diff suppressed because one or more lines are too long
@@ -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",
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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: [
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user