mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-06-19 21:17:45 +00:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b2bda58d5 | |||
| 8c161715f7 | |||
| 2ce3c737d1 | |||
| 80e687da6b | |||
| 4a17b4fc9e | |||
| 620af7f752 | |||
| e1658cc924 | |||
| b962d0c38b | |||
| 69b0237136 | |||
| 9c55d5a4c5 | |||
| 4256b05d2b | |||
| 93d8acec5e | |||
| db6be6320d | |||
| d1ddafea1c | |||
| 83ac1341de | |||
| e097f212b0 | |||
| f32228961b | |||
| e5654b17bc | |||
| 617670cbaf | |||
| 5c7b986db8 | |||
| bf74f32075 | |||
| 67167ec8d1 | |||
| 07d75bdf81 | |||
| 913239459c | |||
| 1dc01890c8 | |||
| 7eb53273c2 | |||
| 099b4aba4f |
@@ -81,8 +81,6 @@ providers/
|
|||||||
- `cheerio`: For HTML parsing
|
- `cheerio`: For HTML parsing
|
||||||
- `getBaseUrl`: Helper to get the provider's base URL (base url are generall stored here https://github.com/himanshu8443/providers/blob/main/modflix.json)
|
- `getBaseUrl`: Helper to get the provider's base URL (base url are generall stored here https://github.com/himanshu8443/providers/blob/main/modflix.json)
|
||||||
- `commonHeaders`: Standard HTTP headers
|
- `commonHeaders`: Standard HTTP headers
|
||||||
- `extractors`: Shared extractor functions
|
|
||||||
- `Aes`: (if needed) for encryption/decryption
|
|
||||||
|
|
||||||
This ensures all providers use the same tools and patterns, making code easier to maintain and extend.
|
This ensures all providers use the same tools and patterns, making code easier to maintain and extend.
|
||||||
|
|
||||||
@@ -260,7 +258,15 @@ linkList: [
|
|||||||
|
|
||||||
This gives you flexibility to support both providers that need extra requests for episodes and those that can return all links up front.
|
This gives you flexibility to support both providers that need extra requests for episodes and those that can return all links up front.
|
||||||
|
|
||||||
## How to Test Your Provider
|
# How to Test Your Provider
|
||||||
|
|
||||||
|
## Test with CLI
|
||||||
|
1. Run `npm run test -- provider_name` (example: `npm run test -- showbox`)
|
||||||
|
- This will do full testing by picking random posts and episodes and testing end-to-end.
|
||||||
|
2. Run `npm run test:provider provider_name function_name` (example: `npm run test:provider showbox getPosts`)
|
||||||
|
- This is for testing a single function, such as getPosts, getSearchPosts, getStream, etc. After entering manually, enter the input.
|
||||||
|
|
||||||
|
## Test in App
|
||||||
|
|
||||||
1. **Start the Dev Server**
|
1. **Start the Dev Server**
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,44 @@ async function buildProvider(providerName) {
|
|||||||
return { providerName, modules: results };
|
return { providerName, modules: results };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function buildUtilityFiles() {
|
||||||
|
const utilityFiles = ["getBaseUrl", "headers", "providerContext"];
|
||||||
|
|
||||||
|
for (const utilityName of utilityFiles) {
|
||||||
|
const utilityPath = path.join(providersDir, `${utilityName}.ts`);
|
||||||
|
|
||||||
|
if (!fs.existsSync(utilityPath)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const result = await esbuild.build({
|
||||||
|
entryPoints: [utilityPath],
|
||||||
|
bundle: true,
|
||||||
|
platform: "node",
|
||||||
|
format: "cjs",
|
||||||
|
target: "es2015",
|
||||||
|
write: false,
|
||||||
|
external: [],
|
||||||
|
minify: false,
|
||||||
|
keepNames: true,
|
||||||
|
treeShaking: true,
|
||||||
|
outfile: `${utilityName}.js`,
|
||||||
|
});
|
||||||
|
|
||||||
|
let code = result.outputFiles[0].text;
|
||||||
|
code = code.replace(/require\(['"]node:.*?['"]\)/g, "{}");
|
||||||
|
|
||||||
|
const outputPath = path.join(__dirname, "dist", `${utilityName}.js`);
|
||||||
|
fs.writeFileSync(outputPath, code);
|
||||||
|
|
||||||
|
console.log(`✓ ${utilityName}.js (${(code.length / 1024).toFixed(1)}kb)`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`✗ Error building ${utilityName}:`, error.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function buildAll() {
|
async function buildAll() {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
console.log(
|
console.log(
|
||||||
@@ -163,6 +201,9 @@ async function buildAll() {
|
|||||||
}
|
}
|
||||||
fs.mkdirSync(distDir, { recursive: true });
|
fs.mkdirSync(distDir, { recursive: true });
|
||||||
|
|
||||||
|
// Build utility files first
|
||||||
|
await buildUtilityFiles();
|
||||||
|
|
||||||
// Build all providers
|
// Build all providers
|
||||||
const results = await Promise.all(providerDirs.map(buildProvider));
|
const results = await Promise.all(providerDirs.map(buildProvider));
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(_0){return __async(this,arguments,function*({url:url,providerContext:providerContext}){try{const{axios:axios,cheerio:cheerio}=providerContext,html=(yield axios.get(url)).data;let $=cheerio.load(html);const episodeLinks=[];if($('a:contains("HubCloud")').map((i,element)=>{const title=$(element).parent().prev().text(),link=$(element).attr("href");link&&(title.includes("Ep")||title.includes("Download"))&&episodeLinks.push({title:title.includes("Download")?"Play":title,link:link})}),0===episodeLinks.length){const streamingServices=["hubcloud","gdflix"];let currentTitle="";$('h5 span[style*="color"], h5').each((i,element)=>{const text=$(element).text().trim();if(text&&(text.match(/\d{3,4}p/)||text.includes("Ep")||text.includes("Episode"))){currentTitle=text;let nextElement=$(element).parent();for(let j=0;j<10&&(nextElement=nextElement.next(),nextElement.length);j++)nextElement.find("a[href]").each((k,linkEl)=>{const href=$(linkEl).attr("href");if(href&&streamingServices.some(service=>href.includes(service))){let serverName="Play";href.includes("hubcloud")?serverName="HubCloud":href.includes("gdflix")?serverName="GDFlix":href.includes("pixeldrain")?serverName="Pixeldrain":href.includes("fastdl")&&(serverName="FastDL");const title=currentTitle?`${currentTitle} - ${serverName}`:serverName;episodeLinks.push({title:title,link:href})}})}})}return episodeLinks.length>0?episodeLinks:[{title:"Play",link:url}]}catch(err){return console.error(err),[{title:"Server 1",link:url}]}})},"getEpisodes");exports.getEpisodes=getEpisodes;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(_0){return __async(this,arguments,function*({url:url,providerContext:providerContext}){var _a;try{const{axios:axios,cheerio:cheerio}=providerContext,html=(yield axios.get(url)).data;let $=cheerio.load(html);const episodeLinks=[];if($('a:contains("HubCloud")').map((i,element)=>{const title=$(element).parent().prev().text(),link=$(element).attr("href");link&&(title.includes("Ep")||title.includes("Download"))&&episodeLinks.push({title:title.includes("Download")?"Play":title,link:link})}),0===episodeLinks.length){const streamingServices=["hubcloud","gdflix"];let currentTitle="";$('h5 span[style*="color"], h5').each((i,element)=>{const text=$(element).text().trim();if(text&&(text.match(/\d{3,4}p/)||text.includes("Ep")||text.includes("Episode"))){currentTitle=text;let nextElement=$(element).parent();for(let j=0;j<10&&(nextElement=nextElement.next(),nextElement.length);j++)nextElement.find("a[href]").each((k,linkEl)=>{const href=$(linkEl).attr("href");if(href&&streamingServices.some(service=>href.includes(service))){let serverName="Play";href.includes("hubcloud")?serverName="HubCloud":href.includes("gdflix")?serverName="GDFlix":href.includes("pixeldrain")?serverName="Pixeldrain":href.includes("fastdl")&&(serverName="FastDL");const title=currentTitle?`${currentTitle} - ${serverName}`:serverName;episodeLinks.push({title:title,link:href})}})}})}if(0===episodeLinks.length){const hubcloudLink=null==(_a=html.match(/https:\/\/hubcloud\.[^\/]+\/drive\/[^"'\s]+/i))?void 0:_a[0];hubcloudLink&&episodeLinks.push({title:"Play",link:hubcloudLink})}return console.log("episodeLinks:",episodeLinks),episodeLinks.length>0?episodeLinks:[{title:"Play",link:url}]}catch(err){return console.error(err),[{title:"Server 1",link:url}]}})},"getEpisodes");exports.getEpisodes=getEpisodes;
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts({url:`${(yield getBaseUrl("drive"))+filter}page/${page}/`,signal:signal,providerContext:providerContext})})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts({url:`${yield getBaseUrl("drive")}page/${page}/?s=${searchQuery}`,signal:signal,providerContext:providerContext})})},"getSearchPosts");function posts(_0){return __async(this,arguments,function*({url:url,signal:signal,providerContext:providerContext}){try{console.log("Fetching URL:",url);const{cheerio:cheerio}=providerContext,res=yield fetch(url,{signal:signal}),data=yield res.text(),$=cheerio.load(data),catalog=[];return $(".poster-card").map((i,element)=>{const title=$(element).find(".poster-title").text(),link=$(element).parent().attr("href"),image=$(element).find(".poster-image img").attr("src");console.log({title:title,link:link,image:image}),title&&link&&image&&catalog.push({title:title.replace("Download","").trim(),link:link,image:image})}),catalog}catch(err){return console.error("drive error ",err),[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts({url:`${(yield getBaseUrl("drive"))+filter}page/${page}/`,signal:signal,providerContext:providerContext})})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext,baseUrl=yield getBaseUrl("drive");return searchPosts({url:buildSearchUrl(baseUrl,searchQuery,page),baseUrl:baseUrl,signal:signal})})},"getSearchPosts");function posts(_0){return __async(this,arguments,function*({url:url,signal:signal,providerContext:providerContext}){try{console.log("Fetching URL:",url);const{cheerio:cheerio}=providerContext,res=yield fetch(url,{signal:signal}),data=yield res.text(),$=cheerio.load(data),catalog=[];return $(".poster-card").map((i,element)=>{const title=$(element).find(".poster-title").text(),link=$(element).parent().attr("href"),image=$(element).find(".poster-image img").attr("src");title&&link&&image&&catalog.push({title:title.replace("Download","").trim(),link:link,image:image})}),catalog}catch(err){return console.error("drive error ",err),[]}})}function searchPosts(_0){return __async(this,arguments,function*({url:url,baseUrl:baseUrl,signal:signal}){var _a,_b;try{console.log("Fetching drive search URL:",url);const res=yield fetch(url,{signal:signal});if(!res.ok)throw new Error(`drive search failed with status ${res.status}`);return null!=(_b=null==(_a=(yield res.json()).hits)?void 0:_a.map(hit=>{var _a2;const document=hit.document,title=null==(_a2=null==document?void 0:document.post_title)?void 0:_a2.trim(),link=(null==document?void 0:document.permalink)?normalizeUrl(baseUrl,document.permalink):"",image=(null==document?void 0:document.post_thumbnail)?normalizeUrl(baseUrl,document.post_thumbnail):"";return title&&link&&image?{title:title,link:link,image:image}:null}).filter(post=>null!==post))?_b:[]}catch(err){return console.error("drive search error ",err),[]}})}function buildSearchUrl(baseUrl,searchQuery,page){const separator=baseUrl.includes("?")?"&":"?";return`${trimTrailingSlash(baseUrl)}/search.php${separator}q=${encodeURIComponent(searchQuery)}&page=${page}`}function normalizeUrl(baseUrl,value){return value?/^https?:\/\//i.test(value)?value:value.startsWith("//")?`https:${value}`:value.startsWith("/")?`${trimTrailingSlash(baseUrl)}${value}`:`${trimTrailingSlash(baseUrl)}/${trimLeadingSlash(value)}`:""}function trimTrailingSlash(value){return value.replace(/\/+$/,"")}function trimLeadingSlash(value){return value.replace(/^\/+/,"")}__name(posts,"posts"),__name(searchPosts,"searchPosts"),__name(buildSearchUrl,"buildSearchUrl"),__name(normalizeUrl,"normalizeUrl"),__name(trimTrailingSlash,"trimTrailingSlash"),__name(trimLeadingSlash,"trimLeadingSlash"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+67
@@ -0,0 +1,67 @@
|
|||||||
|
"use strict";
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
var __async = (__this, __arguments, generator) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
var fulfilled = (value) => {
|
||||||
|
try {
|
||||||
|
step(generator.next(value));
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var rejected = (value) => {
|
||||||
|
try {
|
||||||
|
step(generator.throw(value));
|
||||||
|
} catch (e) {
|
||||||
|
reject(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
||||||
|
step((generator = generator.apply(__this, __arguments)).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// providers/getBaseUrl.ts
|
||||||
|
var getBaseUrl_exports = {};
|
||||||
|
__export(getBaseUrl_exports, {
|
||||||
|
getBaseUrl: () => getBaseUrl
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(getBaseUrl_exports);
|
||||||
|
var expireTime = 60 * 60 * 1e3;
|
||||||
|
var getBaseUrl = /* @__PURE__ */ __name((providerValue) => __async(null, null, function* () {
|
||||||
|
try {
|
||||||
|
let baseUrl = "";
|
||||||
|
const cacheKey = "CacheBaseUrl" + providerValue;
|
||||||
|
const timeKey = "baseUrlTime" + providerValue;
|
||||||
|
const baseUrlRes = yield fetch(
|
||||||
|
"https://himanshu8443.github.io/providers/modflix.json"
|
||||||
|
);
|
||||||
|
const baseUrlData = yield baseUrlRes.json();
|
||||||
|
baseUrl = baseUrlData[providerValue].url;
|
||||||
|
return baseUrl;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error fetching baseUrl: ${providerValue}`, error);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}), "getBaseUrl");
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
0 && (module.exports = {
|
||||||
|
getBaseUrl
|
||||||
|
});
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+37
@@ -0,0 +1,37 @@
|
|||||||
|
"use strict";
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// providers/headers.ts
|
||||||
|
var headers_exports = {};
|
||||||
|
__export(headers_exports, {
|
||||||
|
headers: () => headers
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(headers_exports);
|
||||||
|
var headers = {
|
||||||
|
"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-Site': 'none',
|
||||||
|
// 'Sec-Fetch-User': '?1',
|
||||||
|
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0"
|
||||||
|
};
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
0 && (module.exports = {
|
||||||
|
headers
|
||||||
|
});
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),catalog_exports={};__export(catalog_exports,{catalog:()=>catalog});var catalog=[{title:"Trending",filter:""},{title:"Anime",filter:"/category/anime/"}];exports.catalog=catalog;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),catalog_exports={};__export(catalog_exports,{catalog:()=>catalog});var catalog=[{title:"Latest",filter:""},{title:"Web Series",filter:"/category/web-series/"}];exports.catalog=catalog;
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(_0){return __async(this,arguments,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;console.log("getEpisodeLinks",url);try{const res=yield axios.get(url,{headers:__spreadProps(__spreadValues({},headers),{cookie:"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t"})}),$=cheerio.load(res.data),container=$(".entry-content,.entry-inner, .download-links-div");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h5").each((index,element)=>{const el=$(element),title=el.text().trim(),hubCloudLink=el.next(".downloads-btns-div").find('a[style*="background: linear-gradient(135deg,#e629d0,#007bff);"]').attr("href");if(title&&hubCloudLink){const cleanedTitle=title.replace(/[-:]/g,"").trim();episodes.push({title:cleanedTitle,link:hubCloudLink})}}),episodes}catch(err){return console.log("getEpisodeLinks error: "),[]}})},"getEpisodes");exports.getEpisodes=getEpisodes;
|
"use strict";var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value,__spreadValues=(a,b)=>{for(var prop in b||(b={}))__hasOwnProp.call(b,prop)&&__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b))__propIsEnum.call(b,prop)&&__defNormalProp(a,prop,b[prop]);return a},__spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b)),__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),episodes_exports={};__export(episodes_exports,{getEpisodes:()=>getEpisodes});var getEpisodes=__name(function(_0){return __async(this,arguments,function*({url:url,providerContext:providerContext}){const{axios:axios,cheerio:cheerio,commonHeaders:headers}=providerContext;console.log("getEpisodeLinks",url);try{let res=yield axios.get(url,{headers:__spreadProps(__spreadValues({},headers),{cookie:"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t"})});if(res.data&&res.data.includes("Please turn JavaScript on and reload the page.")){const b1Match=res.data.match(/var b1=atob\(['"]([^'"]+)['"]\)/),a2Match=res.data.match(/_0x2aa8=\[['"]([^'"]+)['"]\]/),c3Match=res.data.match(/c3=toNumbers\(['"]([^'"]+)['"]\)/);if(b1Match&&a2Match&&c3Match){const unescapeHexStr=__name(str=>str.replace(/\\x([0-9A-Fa-f]{2})/g,(_,hex)=>String.fromCharCode(parseInt(hex,16))),"unescapeHexStr"),baseUrl=url.split("/").slice(0,3).join("/"),minJsRes=yield axios.get(`${baseUrl}/min.js`,{headers:headers}),b1Hex=atob(unescapeHexStr(b1Match[1])),a2Hex=atob(unescapeHexStr(a2Match[1])),c3Hex=unescapeHexStr(c3Match[1]),newCookie=`Antiddos-systems-DH=${new Function("c3Hex","a1Hex","b2Hex",`\n ${minJsRes.data}\n function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}\n function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e='',f=0;f<d.length;f++)e+=(16>d[f]?'0':'')+d[f].toString(16);return e.toLowerCase()}\n return toHex(slowAES.decrypt(toNumbers(c3Hex), 2, toNumbers(a1Hex), toNumbers(b2Hex)));\n `)(c3Hex,a2Hex,b1Hex)}`;res=yield axios.get(url,{headers:__spreadProps(__spreadValues({},headers),{Cookie:newCookie})})}}const $=cheerio.load(res.data),container=$(".entry-content,.entry-inner, .download-links-div");$(".unili-content,.code-block-1").remove();const episodes=[];return container.find("h3, h4, h5, p").each((index,element)=>{const el=$(element),title=el.text().trim(),link=el.nextAll().find("a").first().attr("href");if(title&&link&&title.match(/Episode|Ep|E\d+/i)&&title.length<150){const cleanedTitle=title.replace(/[-:]/g,"").trim();episodes.some(e=>e.link===link)||episodes.push({title:cleanedTitle,link:link})}}),0===episodes.length&&$("a").each((i,el)=>{const href=$(el).attr("href");if(href&&(href.includes("mdrive")||href.includes("fastdl")||href.includes("filebee")||href.includes("gdflix"))){const title=$(el).parent().prev().text().trim()||$(el).text().trim()||`Episode ${i+1}`;episodes.some(e=>e.link===href)||episodes.push({title:title.replace(/[-:]/g,"").trim(),link:href})}}),episodes}catch(err){return console.log("getEpisodeLinks error: "),[]}})},"getEpisodes");exports.getEpisodes=getEpisodes;
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+57332
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("showbox");return posts({url:`${baseUrl+filter}?page=${page}/`,signal:signal,baseUrl:baseUrl,axios:axios,cheerio:cheerio})})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("showbox");return posts({url:`${baseUrl}/search?keyword=${searchQuery}&page=${page}`,signal:signal,baseUrl:baseUrl,axios:axios,cheerio:cheerio})})},"getSearchPosts");function posts(_0){return __async(this,arguments,function*({url:url,signal:signal,axios:axios,cheerio:cheerio}){try{const data=(yield axios.get(url,{signal:signal})).data,$=cheerio.load(data),catalog=[];return $(".movie-item,.flw-item").map((i,element)=>{const title=$(element).find(".film-name").text().trim(),link=$(element).find("a").attr("href"),image=$(element).find("img").attr("src");title&&link&&image&&catalog.push({title:title,link:link,image:image})}),catalog}catch(err){return[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio}=providerContext,baseUrl=yield getBaseUrl("showbox");return posts({url:`${baseUrl+filter}?page=${page}/`,signal:signal,baseUrl:baseUrl,axios:axios,cheerio:cheerio})})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl,axios:axios,cheerio:cheerio,commonHeaders:commonHeaders}=providerContext,baseUrl=yield getBaseUrl("showbox");return posts({url:`${baseUrl}/search?keyword=${searchQuery}&page=${page}`,signal:signal,baseUrl:baseUrl,axios:axios,cheerio:cheerio,headers:commonHeaders})})},"getSearchPosts");function posts(_0){return __async(this,arguments,function*({url:url,signal:signal,axios:axios,cheerio:cheerio,headers:headers}){let lastError;for(let attempt=1;attempt<=3;attempt++)try{const data=(yield axios.get(url,{signal:signal,headers:headers})).data;console.log(data);const $=cheerio.load(data),catalog=[];return $(".movie-item,.flw-item").map((i,element)=>{const title=$(element).find(".film-name").text().trim(),link=$(element).find("a").attr("href"),image=$(element).find("img").attr("src");console.log(title,link,image),title&&link&&image&&catalog.push({title:title,link:link,image:image})}),catalog}catch(err){if(lastError=err,signal.aborted||3===attempt)throw err}throw lastError})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var getStream=__name(function(_0){return __async(this,arguments,function*({link:id,signal:signal,providerContext:providerContext}){try{const{axios:axios,cheerio:cheerio}=providerContext,stream=[],[,epId]=id.split("&"),url=`https://febbox.vercel.app/api/video-quality?fid=${epId}`,data=(yield axios.get(url,{signal:signal})).data,$=cheerio.load(data.html);return $(".file_quality").each((i,el)=>{const server=$(el).find("p.name").text()+" - "+$(el).find("p.size").text()+" - "+$(el).find("p.speed").text(),link=$(el).attr("data-url");link&&stream.push({server:server,type:"mkv",link:link})}),stream}catch(err){return[]}})},"getStream");exports.getStream=getStream;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),stream_exports={};__export(stream_exports,{getStream:()=>getStream});var getStream=__name(function(_0){return __async(this,arguments,function*({link:id,signal:signal,providerContext:providerContext}){try{const{axios:axios,cheerio:cheerio}=providerContext,stream=[],[,epId]=id.split("&"),url=`https://feb.8man.workers.dev/?fid=${epId}`,data=(yield axios.get(url,{signal:signal})).data,$=cheerio.load(data.html);return $(".file_quality").each((i,el)=>{const server=$(el).find("p.name").text()+" - "+$(el).find("p.size").text()+" - "+$(el).find("p.speed").text(),link=$(el).attr("data-url");link&&stream.push({server:server,type:"mkv",link:link})}),console.log(stream),stream}catch(err){return[]}})},"getStream");exports.getStream=getStream;
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,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",Cookie:"popads_user_id=6ba8fe60a481387a3249f05aa058822d","Sec-Fetch-Site":"none","Sec-Fetch-User":"?1","Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0"},getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts(`${(yield getBaseUrl("Topmovies"))+filter}/page/${page}/`,signal,providerContext)})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts(`${yield getBaseUrl("Topmovies")}/search/${searchQuery}/page/${page}/`,signal,providerContext)})},"getSearchPosts");function posts(url,signal,providerContext){return __async(this,null,function*(){try{const{axios:axios,cheerio:cheerio}=providerContext,data=(yield axios.get(url,{headers:headers,signal:signal})).data,$=cheerio.load(data),catalog=[];return $(".post-cards").find("article").map((i,element)=>{const title=$(element).find("a").attr("title"),link=$(element).find("a").attr("href"),image=$(element).find("img").attr("data-src")||$(element).find("img").attr("src")||"";title&&link&&catalog.push({title:title.replace("Download","").trim(),link:link,image:image})}),catalog}catch(err){return console.error("mod error ",err),[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var headers={Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,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","Upgrade-Insecure-Requests":"1","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0"},getPosts=__name(function(_0){return __async(this,arguments,function*({filter:filter,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts(`${(yield getBaseUrl("Topmovies"))+filter}/page/${page}/`,signal,providerContext)})},"getPosts"),getSearchPosts=__name(function(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page,signal:signal,providerContext:providerContext}){const{getBaseUrl:getBaseUrl}=providerContext;return posts(`${yield getBaseUrl("Topmovies")}/search/${searchQuery}/page/${page}/`,signal,providerContext)})},"getSearchPosts");function posts(url,signal,providerContext){return __async(this,null,function*(){try{const{axios:axios,cheerio:cheerio}=providerContext,data=(yield axios.get(url,{headers:headers,signal:signal})).data,$=cheerio.load(data),catalog=[];return $(".post-cards").find("article").map((i,element)=>{const title=$(element).find("a").attr("title"),link=$(element).find("a").attr("href"),image=$(element).find("img").attr("data-src")||$(element).find("img").attr("src")||"";title&&link&&catalog.push({title:title.replace("Download","").trim(),link:link,image:image})}),catalog}catch(err){return console.error("mod error ",err),[]}})}__name(posts,"posts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
||||||
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),catalog_exports={};__export(catalog_exports,{catalog:()=>catalog,genres:()=>genres});var catalog=[{title:"New",filter:""},{title:"Netflix",filter:"web-series/netflix"},{title:"Amazon Prime",filter:"web-series/amazon-prime-video"},{title:"4K Movies",filter:"movies-by-quality/2160p"}],genres=[{title:"Action",filter:"category/movies-by-genres/action"},{title:"Adventure",filter:"category/movies-by-genres/adventure"},{title:"Animation",filter:"category/movies-by-genres/animation"},{title:"Biography",filter:"category/movies-by-genres/biography"},{title:"Comedy",filter:"category/movies-by-genres/comedy"},{title:"Crime",filter:"category/movies-by-genres/crime"},{title:"Documentary",filter:"category/movies-by-genres/documentary"},{title:"Drama",filter:"category/movies-by-genres/drama"},{title:"Family",filter:"category/movies-by-genres/family"},{title:"Fantasy",filter:"category/movies-by-genres/fantasy"},{title:"History",filter:"category/movies-by-genres/history"},{title:"Horror",filter:"category/movies-by-genres/horror"},{title:"Music",filter:"category/movies-by-genres/music"},{title:"Mystery",filter:"category/movies-by-genres/mystery"},{title:"Romance",filter:"category/movies-by-genres/romance"},{title:"Sci-Fi",filter:"category/movies-by-genres/sci-fi"},{title:"Sport",filter:"category/movies-by-genres/sport"},{title:"Thriller",filter:"category/movies-by-genres/thriller"},{title:"War",filter:"category/movies-by-genres/war"},{title:"Western",filter:"category/movies-by-genres/western"}];exports.catalog=catalog,exports.genres=genres;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),catalog_exports={};__export(catalog_exports,{catalog:()=>catalog,genres:()=>genres});var catalog=[{title:"New",filter:""},{title:"Netflix",filter:"web-series/netflix"},{title:"Amazon Prime",filter:"web-series/amazon-prime-video"},{title:"Apple TV+",filter:"web-series/apple-tv"}],genres=[{title:"Action",filter:"category/movies-by-genres/action"},{title:"Adventure",filter:"category/movies-by-genres/adventure"},{title:"Animation",filter:"category/movies-by-genres/animation"},{title:"Biography",filter:"category/movies-by-genres/biography"},{title:"Comedy",filter:"category/movies-by-genres/comedy"},{title:"Crime",filter:"category/movies-by-genres/crime"},{title:"Documentary",filter:"category/movies-by-genres/documentary"},{title:"Drama",filter:"category/movies-by-genres/drama"},{title:"Family",filter:"category/movies-by-genres/family"},{title:"Fantasy",filter:"category/movies-by-genres/fantasy"},{title:"History",filter:"category/movies-by-genres/history"},{title:"Horror",filter:"category/movies-by-genres/horror"},{title:"Music",filter:"category/movies-by-genres/music"},{title:"Mystery",filter:"category/movies-by-genres/mystery"},{title:"Romance",filter:"category/movies-by-genres/romance"},{title:"Sci-Fi",filter:"category/movies-by-genres/sci-fi"},{title:"Sport",filter:"category/movies-by-genres/sport"},{title:"Thriller",filter:"category/movies-by-genres/thriller"},{title:"War",filter:"category/movies-by-genres/war"},{title:"Western",filter:"category/movies-by-genres/western"}];exports.catalog=catalog,exports.genres=genres;
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
|||||||
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var defaultHeaders={Referer:"https://www.google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","Accept-Language":"en-US,en;q=0.9",Pragma:"no-cache","Cache-Control":"no-cache"};function getPosts(_0){return __async(this,arguments,function*({filter:filter,page:page=1,signal:signal,providerContext:providerContext}){return fetchPosts({filter:filter,page:page,query:"",signal:signal,providerContext:providerContext})})}function getSearchPosts(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page=1,signal:signal,providerContext:providerContext}){return fetchPosts({filter:"",page:page,query:searchQuery,signal:signal,providerContext:providerContext})})}function fetchPosts(_0){return __async(this,arguments,function*({filter:filter,query:query,page:page=1,signal:signal,providerContext:providerContext}){try{const baseUrl=yield providerContext.getBaseUrl("zeefliz");let url;if(query&&query.trim()){const params=new URLSearchParams;params.append("s",query.trim()),page>1&¶ms.append("paged",page.toString()),url=`${baseUrl}/?${params.toString()}`}else url=filter?filter.startsWith("/")?`${baseUrl}${filter.replace(/\/$/,"")}${page>1?`/page/${page}`:""}`:`${baseUrl}/${filter}${page>1?`/page/${page}`:""}`:`${baseUrl}${page>1?`/page/${page}`:""}`;const{axios:axios,cheerio:cheerio}=providerContext,res=yield axios.get(url,{headers:defaultHeaders,signal:signal}),$=cheerio.load(res.data||""),resolveUrl=__name(href=>(null==href?void 0:href.startsWith("http"))?href:new URL(href,baseUrl).href,"resolveUrl"),seen=new Set,catalog=[];return $("section.site-main article.post").each((_,el)=>{var _a;const card=$(el);let link=card.find("a[href]").first().attr("href")||"";if(!link)return;if(link=resolveUrl(link),seen.has(link))return;let title=card.find("h3.entry-title a").text().trim()||card.find("a[rel='bookmark']").text().trim()||(null==(_a=card.find("a[title]").attr("title"))?void 0:_a.trim())||"";if(title=title.replace(/^Download\s*/i,"").trim(),!title)return;let img=card.find("img").attr("bv-data-src")||card.find("img").attr("src")||card.find("img").attr("data-src")||card.find("img").attr("data-original")||"";const image=img?resolveUrl(img):"";seen.add(link),catalog.push({title:title,link:link,image:image})}),catalog.slice(0,100)}catch(err){return console.error("fetchPosts error:",err instanceof Error?err.message:String(err)),[]}})}__name(getPosts,"getPosts"),__name(getSearchPosts,"getSearchPosts"),__name(fetchPosts,"fetchPosts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__name=(target,value)=>__defProp(target,"name",{value:value,configurable:!0}),__export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&"object"==typeof from||"function"==typeof from)for(let key of __getOwnPropNames(from))__hasOwnProp.call(to,key)||key===except||__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to},__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod),__async=(__this,__arguments,generator)=>new Promise((resolve,reject)=>{var fulfilled=value=>{try{step(generator.next(value))}catch(e){reject(e)}},rejected=value=>{try{step(generator.throw(value))}catch(e){reject(e)}},step=x=>x.done?resolve(x.value):Promise.resolve(x.value).then(fulfilled,rejected);step((generator=generator.apply(__this,__arguments)).next())}),posts_exports={};__export(posts_exports,{getPosts:()=>getPosts,getSearchPosts:()=>getSearchPosts});var defaultHeaders={Referer:"https://www.google.com","User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8","Accept-Language":"en-US,en;q=0.9",Pragma:"no-cache","Cache-Control":"no-cache"};function getPosts(_0){return __async(this,arguments,function*({filter:filter,page:page=1,signal:signal,providerContext:providerContext}){return fetchPosts({filter:filter,page:page,query:"",signal:signal,providerContext:providerContext})})}function getSearchPosts(_0){return __async(this,arguments,function*({searchQuery:searchQuery,page:page=1,signal:signal,providerContext:providerContext}){return fetchPosts({filter:"",page:page,query:searchQuery,signal:signal,providerContext:providerContext})})}function fetchPosts(_0){return __async(this,arguments,function*({filter:filter,query:query,page:page=1,signal:signal,providerContext:providerContext}){try{const baseUrl=yield providerContext.getBaseUrl("zeefliz");let url;if(query&&query.trim()){const params=new URLSearchParams;params.append("s",query.trim()),page>1&¶ms.append("paged",page.toString()),url=`${baseUrl}/?${params.toString()}`}else url=filter?filter.startsWith("/")?`${baseUrl}${filter.replace(/\/$/,"")}${page>1?`/page/${page}`:""}`:`${baseUrl}/${filter}${page>1?`/page/${page}`:""}`:`${baseUrl}${page>1?`/page/${page}`:""}`;const{axios:axios,cheerio:cheerio}=providerContext,res=yield axios.get(url,{headers:defaultHeaders,signal:signal}),$=cheerio.load(res.data||""),resolveUrl=__name(href=>(null==href?void 0:href.startsWith("http"))?href:new URL(href,baseUrl).href,"resolveUrl"),seen=new Set,catalog=[];return $("section.site-main article.post").each((_,el)=>{var _a;const card=$(el);let link=card.find("a[href]").first().attr("href")||"";if(!link)return;if(link=resolveUrl(link),seen.has(link))return;let title=card.find("h3.entry-title a").text().trim()||card.find("a[rel='bookmark']").text().trim()||(null==(_a=card.find("a[title]").attr("title"))?void 0:_a.trim())||"";if(title=title.replace(/^Download\s*/i,"").trim(),!title)return;let img=card.find("img").attr("data-src")||card.find("img").attr("bv-data-src")||card.find("img").attr("src")||card.find("img").attr("data-original")||"";const image=img?resolveUrl(img):"";seen.add(link),catalog.push({title:title,link:link,image:image})}),catalog.slice(0,100)}catch(err){return console.error("fetchPosts error:",err instanceof Error?err.message:String(err)),[]}})}__name(getPosts,"getPosts"),__name(getSearchPosts,"getSearchPosts"),__name(fetchPosts,"fetchPosts"),exports.getPosts=getPosts,exports.getSearchPosts=getSearchPosts;
|
||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+330
-330
@@ -1,330 +1,330 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"display_name": "VegaMovies",
|
"display_name": "VegaMovies",
|
||||||
"value": "vega",
|
"value": "vega",
|
||||||
"version": "1.16",
|
"version": "2.8",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MultiStream",
|
"display_name": "MultiStream",
|
||||||
"value": "autoEmbed",
|
"value": "autoEmbed",
|
||||||
"version": "1.6",
|
"version": "1.6",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MoviesDrive",
|
"display_name": "MoviesDrive",
|
||||||
"value": "drive",
|
"value": "drive",
|
||||||
"version": "1.7",
|
"version": "2.1",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MultiMovies",
|
"display_name": "MultiMovies",
|
||||||
"value": "multi",
|
"value": "multi",
|
||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "4khdHub",
|
"display_name": "4khdHub",
|
||||||
"value": "4khdhub",
|
"value": "4khdhub",
|
||||||
"version": "1.9",
|
"version": "2.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Cinewood",
|
"display_name": "Cinewood",
|
||||||
"value": "1cinevood",
|
"value": "1cinevood",
|
||||||
"version": "1.2",
|
"version": "1.4",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "World4uFree",
|
"display_name": "World4uFree",
|
||||||
"value": "world4u",
|
"value": "world4u",
|
||||||
"version": "1.4",
|
"version": "1.4",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "KatMoviesHd",
|
"display_name": "KatMoviesHd",
|
||||||
"value": "katmovies",
|
"value": "katmovies",
|
||||||
"version": "1.4",
|
"version": "1.6",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MoviesMod",
|
"display_name": "MoviesMod",
|
||||||
"value": "mod",
|
"value": "mod",
|
||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "UHDMovies",
|
"display_name": "UHDMovies",
|
||||||
"value": "uhd",
|
"value": "uhd",
|
||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "ProtonMovies",
|
"display_name": "ProtonMovies",
|
||||||
"value": "protonMovies",
|
"value": "protonMovies",
|
||||||
"version": "1.4",
|
"version": "1.4",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "CinemaLuxe",
|
"display_name": "CinemaLuxe",
|
||||||
"value": "cinemaLuxe",
|
"value": "cinemaLuxe",
|
||||||
"version": "1.5",
|
"version": "1.7",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "FilmyFly",
|
"display_name": "FilmyFly",
|
||||||
"value": "filmyfly",
|
"value": "filmyfly",
|
||||||
"version": "1.4",
|
"version": "1.4",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MovieBox",
|
"display_name": "MovieBox",
|
||||||
"value": "movieBox",
|
"value": "movieBox",
|
||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Movies4U",
|
"display_name": "Movies4U",
|
||||||
"value": "movies4u",
|
"value": "movies4u",
|
||||||
"version": "1.2",
|
"version": "1.5",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "KmMovies",
|
"display_name": "KmMovies",
|
||||||
"value": "kmMovies",
|
"value": "kmMovies",
|
||||||
"version": "1.3",
|
"version": "1.3",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Zeefliz",
|
"display_name": "Zeefliz",
|
||||||
"value": "zeefliz",
|
"value": "zeefliz",
|
||||||
"version": "1.2",
|
"version": "1.5",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "KatMovieFix",
|
"display_name": "KatMovieFix",
|
||||||
"value": "katMovieFix",
|
"value": "katMovieFix",
|
||||||
"version": "1.4",
|
"version": "1.6",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Ringz",
|
"display_name": "Ringz",
|
||||||
"value": "ringz",
|
"value": "ringz",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "NetflixMirror",
|
"display_name": "NetflixMirror",
|
||||||
"value": "netflixMirror",
|
"value": "netflixMirror",
|
||||||
"version": "1.7",
|
"version": "1.7",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "PrimeMirror",
|
"display_name": "PrimeMirror",
|
||||||
"value": "primeMirror",
|
"value": "primeMirror",
|
||||||
"version": "1.6",
|
"version": "1.6",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "HdHub4u",
|
"display_name": "HdHub4u",
|
||||||
"value": "hdhub4u",
|
"value": "hdhub4u",
|
||||||
"version": "1.4",
|
"version": "1.9",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Ogomovies",
|
"display_name": "Ogomovies",
|
||||||
"value": "ogomovies",
|
"value": "ogomovies",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "india",
|
"type": "india",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "A.111477",
|
"display_name": "A.111477",
|
||||||
"value": "a111477",
|
"value": "a111477",
|
||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "VadaPav",
|
"display_name": "VadaPav",
|
||||||
"value": "vadapav",
|
"value": "vadapav",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MoviesApi",
|
"display_name": "MoviesApi",
|
||||||
"value": "moviesApi",
|
"value": "moviesApi",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "MoviezWap",
|
"display_name": "MoviezWap",
|
||||||
"value": "moviezwap",
|
"value": "moviezwap",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "india",
|
"type": "india",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "ShowBox",
|
"display_name": "ShowBox",
|
||||||
"value": "showbox",
|
"value": "showbox",
|
||||||
"version": "1.1",
|
"version": "1.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "RidoMovies",
|
"display_name": "RidoMovies",
|
||||||
"value": "ridoMovies",
|
"value": "ridoMovies",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "FlixHQ",
|
"display_name": "FlixHQ",
|
||||||
"value": "flixhq",
|
"value": "flixhq",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Primewire",
|
"display_name": "Primewire",
|
||||||
"value": "primewire",
|
"value": "primewire",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "HiAnime",
|
"display_name": "HiAnime",
|
||||||
"value": "hiAnime",
|
"value": "hiAnime",
|
||||||
"version": "1.1",
|
"version": "1.1",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Animetsu",
|
"display_name": "Animetsu",
|
||||||
"value": "animetsu",
|
"value": "animetsu",
|
||||||
"version": "1.1",
|
"version": "1.1",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "TokyoInsider",
|
"display_name": "TokyoInsider",
|
||||||
"value": "tokyoInsider",
|
"value": "tokyoInsider",
|
||||||
"version": "1.0",
|
"version": "1.0",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "KissKh",
|
"display_name": "KissKh",
|
||||||
"value": "kissKh",
|
"value": "kissKh",
|
||||||
"version": "1.2",
|
"version": "1.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "english",
|
"type": "english",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Dooflix",
|
"display_name": "Dooflix",
|
||||||
"value": "dooflix",
|
"value": "dooflix",
|
||||||
"version": "1.4",
|
"version": "1.4",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "india",
|
"type": "india",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "RogMovies",
|
"display_name": "RogMovies",
|
||||||
"value": "luxMovies",
|
"value": "luxMovies",
|
||||||
"version": "1.9",
|
"version": "2.3",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "india",
|
"type": "india",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "TopMovies",
|
"display_name": "TopMovies",
|
||||||
"value": "topmovies",
|
"value": "topmovies",
|
||||||
"version": "1.1",
|
"version": "1.2",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "india",
|
"type": "india",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "GuardaHD",
|
"display_name": "GuardaHD",
|
||||||
"value": "guardahd",
|
"value": "guardahd",
|
||||||
"version": "1.6",
|
"version": "1.6",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "italy",
|
"type": "italy",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "SkyMovieHD",
|
"display_name": "SkyMovieHD",
|
||||||
"value": "skyMovieHD",
|
"value": "skyMovieHD",
|
||||||
"version": "1.4",
|
"version": "1.6",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "global",
|
"type": "global",
|
||||||
"disabled": true
|
"disabled": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"display_name": "Joya9tv",
|
"display_name": "Joya9tv",
|
||||||
"value": "Joya9tv",
|
"value": "Joya9tv",
|
||||||
"version": "1.3",
|
"version": "1.5",
|
||||||
"icon": "",
|
"icon": "",
|
||||||
"type": "india",
|
"type": "india",
|
||||||
"disabled": false
|
"disabled": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.10.0",
|
"axios": "^1.10.0",
|
||||||
"cheerio": "^1.1.0",
|
"cheerio": "^1.1.0",
|
||||||
"react-native-aes-crypto": "^3.2.1",
|
|
||||||
"rimraf": "^6.0.1",
|
"rimraf": "^6.0.1",
|
||||||
"zod": "^4.0.2"
|
"zod": "^4.0.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,8 +23,10 @@ export async function getStream({
|
|||||||
const res = await axios.get(link, { headers, signal });
|
const res = await axios.get(link, { headers, signal });
|
||||||
const text = res.data;
|
const text = res.data;
|
||||||
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
|
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
|
||||||
const decodedString: any = decodeString(encryptedString);
|
const decodedString: any = decodeString(encryptedString) || link;
|
||||||
link = atob(decodedString?.o);
|
console.log("decodedString", decodedString);
|
||||||
|
link = safeAtob(decodedString?.o) || link;
|
||||||
|
console.log("Decoded link", link);
|
||||||
const redirectLink = await getRedirectLinks(link, signal, headers);
|
const redirectLink = await getRedirectLinks(link, signal, headers);
|
||||||
console.log("redirectLink", redirectLink);
|
console.log("redirectLink", redirectLink);
|
||||||
if (redirectLink.includes("hubcloud") || redirectLink.includes("/drive/")) {
|
if (redirectLink.includes("hubcloud") || redirectLink.includes("/drive/")) {
|
||||||
@@ -176,6 +178,14 @@ function rot13(str: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const safeAtob = (str: string) => {
|
||||||
|
try {
|
||||||
|
return atob(str);
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export function decodeString(encryptedString: string) {
|
export function decodeString(encryptedString: string) {
|
||||||
try {
|
try {
|
||||||
// First base64 decode
|
// First base64 decode
|
||||||
|
|||||||
@@ -74,8 +74,18 @@ export const getEpisodes = async function ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (episodeLinks.length === 0) {
|
||||||
|
// https://hubcloud.foo/drive/gvdzmpioeeaf8mp
|
||||||
|
// find link contain hubcloud and have drive in url using regex
|
||||||
|
const hubcloudLink = html.match(
|
||||||
|
/https:\/\/hubcloud\.[^\/]+\/drive\/[^"'\s]+/i,
|
||||||
|
)?.[0];
|
||||||
|
if (hubcloudLink) {
|
||||||
|
episodeLinks.push({ title: "Play", link: hubcloudLink });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// console.log(episodeLinks);
|
console.log("episodeLinks:", episodeLinks);
|
||||||
return episodeLinks.length > 0
|
return episodeLinks.length > 0
|
||||||
? episodeLinks
|
? episodeLinks
|
||||||
: [{ title: "Play", link: url }];
|
: [{ title: "Play", link: url }];
|
||||||
|
|||||||
+172
-73
@@ -1,73 +1,172 @@
|
|||||||
import { Post, ProviderContext } from "../types";
|
import { Post, ProviderContext } from "../types";
|
||||||
|
|
||||||
export const getPosts = async function ({
|
export const getPosts = async function ({
|
||||||
filter,
|
filter,
|
||||||
page,
|
page,
|
||||||
signal,
|
signal,
|
||||||
providerContext,
|
providerContext,
|
||||||
}: {
|
}: {
|
||||||
filter: string;
|
filter: string;
|
||||||
page: number;
|
page: number;
|
||||||
providerValue: string;
|
providerValue: string;
|
||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
providerContext: ProviderContext;
|
providerContext: ProviderContext;
|
||||||
}): Promise<Post[]> {
|
}): Promise<Post[]> {
|
||||||
const { getBaseUrl } = providerContext;
|
const { getBaseUrl } = providerContext;
|
||||||
const baseUrl = await getBaseUrl("drive");
|
const baseUrl = await getBaseUrl("drive");
|
||||||
const url = `${baseUrl + filter}page/${page}/`;
|
const url = `${baseUrl + filter}page/${page}/`;
|
||||||
return posts({ url, signal, providerContext });
|
return posts({ url, signal, providerContext });
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchPosts = async function ({
|
export const getSearchPosts = async function ({
|
||||||
searchQuery,
|
searchQuery,
|
||||||
page,
|
page,
|
||||||
signal,
|
signal,
|
||||||
providerContext,
|
providerContext,
|
||||||
}: {
|
}: {
|
||||||
searchQuery: string;
|
searchQuery: string;
|
||||||
page: number;
|
page: number;
|
||||||
providerValue: string;
|
providerValue: string;
|
||||||
providerContext: ProviderContext;
|
providerContext: ProviderContext;
|
||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
}): Promise<Post[]> {
|
}): Promise<Post[]> {
|
||||||
const { getBaseUrl } = providerContext;
|
const { getBaseUrl } = providerContext;
|
||||||
const baseUrl = await getBaseUrl("drive");
|
const baseUrl = await getBaseUrl("drive");
|
||||||
const url = `${baseUrl}page/${page}/?s=${searchQuery}`;
|
const url = buildSearchUrl(baseUrl, searchQuery, page);
|
||||||
return posts({ url, signal, providerContext });
|
return searchPosts({
|
||||||
};
|
url,
|
||||||
|
baseUrl,
|
||||||
async function posts({
|
signal,
|
||||||
url,
|
});
|
||||||
signal,
|
};
|
||||||
providerContext,
|
|
||||||
}: {
|
async function posts({
|
||||||
url: string;
|
url,
|
||||||
signal: AbortSignal;
|
signal,
|
||||||
providerContext: ProviderContext;
|
providerContext,
|
||||||
}): Promise<Post[]> {
|
}: {
|
||||||
try {
|
url: string;
|
||||||
console.log("Fetching URL:", url);
|
signal: AbortSignal;
|
||||||
const { cheerio } = providerContext;
|
providerContext: ProviderContext;
|
||||||
const res = await fetch(url, { signal });
|
}): Promise<Post[]> {
|
||||||
const data = await res.text();
|
try {
|
||||||
const $ = cheerio.load(data);
|
console.log("Fetching URL:", url);
|
||||||
const catalog: Post[] = [];
|
const { cheerio } = providerContext;
|
||||||
$(".poster-card").map((i, element) => {
|
const res = await fetch(url, { signal });
|
||||||
const title = $(element).find(".poster-title").text();
|
const data = await res.text();
|
||||||
const link = $(element).parent().attr("href");
|
const $ = cheerio.load(data);
|
||||||
const image = $(element).find(".poster-image img").attr("src");
|
const catalog: Post[] = [];
|
||||||
console.log({ title, link, image });
|
$(".poster-card").map((i, element) => {
|
||||||
if (title && link && image) {
|
const title = $(element).find(".poster-title").text();
|
||||||
catalog.push({
|
const link = $(element).parent().attr("href");
|
||||||
title: title.replace("Download", "").trim(),
|
const image = $(element).find(".poster-image img").attr("src");
|
||||||
link: link,
|
if (title && link && image) {
|
||||||
image: image,
|
catalog.push({
|
||||||
});
|
title: title.replace("Download", "").trim(),
|
||||||
}
|
link: link,
|
||||||
});
|
image: image,
|
||||||
return catalog;
|
});
|
||||||
} catch (err) {
|
}
|
||||||
console.error("drive error ", err);
|
});
|
||||||
return [];
|
return catalog;
|
||||||
}
|
} catch (err) {
|
||||||
}
|
console.error("drive error ", err);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function searchPosts({
|
||||||
|
url,
|
||||||
|
baseUrl,
|
||||||
|
signal,
|
||||||
|
}: {
|
||||||
|
url: string;
|
||||||
|
baseUrl: string;
|
||||||
|
signal: AbortSignal;
|
||||||
|
}): Promise<Post[]> {
|
||||||
|
try {
|
||||||
|
console.log("Fetching drive search URL:", url);
|
||||||
|
const res = await fetch(url, { signal });
|
||||||
|
|
||||||
|
if (!res.ok) {
|
||||||
|
throw new Error(`drive search failed with status ${res.status}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = (await res.json()) as {
|
||||||
|
hits?: Array<{
|
||||||
|
document?: {
|
||||||
|
permalink?: string;
|
||||||
|
post_thumbnail?: string;
|
||||||
|
post_title?: string;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
data.hits
|
||||||
|
?.map((hit) => {
|
||||||
|
const document = hit.document;
|
||||||
|
const title = document?.post_title?.trim();
|
||||||
|
const link = document?.permalink
|
||||||
|
? normalizeUrl(baseUrl, document.permalink)
|
||||||
|
: "";
|
||||||
|
const image = document?.post_thumbnail
|
||||||
|
? normalizeUrl(baseUrl, document.post_thumbnail)
|
||||||
|
: "";
|
||||||
|
|
||||||
|
if (!title || !link || !image) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
title,
|
||||||
|
link,
|
||||||
|
image,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.filter((post): post is Post => post !== null) ?? []
|
||||||
|
);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("drive search error ", err);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildSearchUrl(
|
||||||
|
baseUrl: string,
|
||||||
|
searchQuery: string,
|
||||||
|
page: number,
|
||||||
|
): string {
|
||||||
|
const separator = baseUrl.includes("?") ? "&" : "?";
|
||||||
|
return `${trimTrailingSlash(baseUrl)}/search.php${separator}q=${encodeURIComponent(
|
||||||
|
searchQuery,
|
||||||
|
)}&page=${page}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeUrl(baseUrl: string, value: string): string {
|
||||||
|
if (!value) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/^https?:\/\//i.test(value)) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.startsWith("//")) {
|
||||||
|
return `https:${value}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.startsWith("/")) {
|
||||||
|
return `${trimTrailingSlash(baseUrl)}${value}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${trimTrailingSlash(baseUrl)}/${trimLeadingSlash(value)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function trimTrailingSlash(value: string): string {
|
||||||
|
return value.replace(/\/+$/, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
function trimLeadingSlash(value: string): string {
|
||||||
|
return value.replace(/^\/+/, "");
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,28 @@ const hubcloudDecode = function (value: string) {
|
|||||||
return atob(value.toString());
|
return atob(value.toString());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getPixelDrainUrl = (html: string) => {
|
||||||
|
const match = html.match(/var\s+pxl\s*=\s*['"]([^'"]+)['"];?/i);
|
||||||
|
return match?.[1] || "";
|
||||||
|
};
|
||||||
|
|
||||||
|
const getRedirectedPixelDrainUrl = (
|
||||||
|
...htmlSources: Array<string | undefined>
|
||||||
|
) => {
|
||||||
|
for (const html of htmlSources) {
|
||||||
|
if (!html) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
const redirectedUrl = getPixelDrainUrl(html);
|
||||||
|
if (redirectedUrl) {
|
||||||
|
return redirectedUrl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
};
|
||||||
|
|
||||||
export async function hubcloudExtractor(
|
export async function hubcloudExtractor(
|
||||||
link: string,
|
link: string,
|
||||||
signal: AbortSignal,
|
signal: AbortSignal,
|
||||||
@@ -16,7 +38,7 @@ export async function hubcloudExtractor(
|
|||||||
headers["Cookie"] =
|
headers["Cookie"] =
|
||||||
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; xla=s4t; cf_clearance=woQrFGXtLfmEMBEiGUsVHrUBMT8s3cmguIzmMjmvpkg-1770053679-1.2.1.1-xBrQdciOJsweUF6F2T_OtH6jmyanN_TduQ0yslc_XqjU6RcHSxI7.YOKv6ry7oYo64868HYoULnVyww536H2eVI3R2e4wKzsky6abjPdfQPxqpUaXjxfJ02o6jl3_Vkwr4uiaU7Wy596Vdst3y78HXvVmKdIohhtPvp.vZ9_L7wvWdce0GRixjh_6JiqWmWMws46hwEt3hboaS1e1e4EoWCvj5b0M_jVwvSxBOAW5emFzvT3QrnRh4nyYmKDERnY";
|
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; xla=s4t; cf_clearance=woQrFGXtLfmEMBEiGUsVHrUBMT8s3cmguIzmMjmvpkg-1770053679-1.2.1.1-xBrQdciOJsweUF6F2T_OtH6jmyanN_TduQ0yslc_XqjU6RcHSxI7.YOKv6ry7oYo64868HYoULnVyww536H2eVI3R2e4wKzsky6abjPdfQPxqpUaXjxfJ02o6jl3_Vkwr4uiaU7Wy596Vdst3y78HXvVmKdIohhtPvp.vZ9_L7wvWdce0GRixjh_6JiqWmWMws46hwEt3hboaS1e1e4EoWCvj5b0M_jVwvSxBOAW5emFzvT3QrnRh4nyYmKDERnY";
|
||||||
console.log("hubcloudExtractor", link);
|
console.log("hubcloudExtractor", link);
|
||||||
console.log("headers", headers);
|
// console.log("headers", headers);
|
||||||
const baseUrl = link.split("/").slice(0, 3).join("/");
|
const baseUrl = link.split("/").slice(0, 3).join("/");
|
||||||
const streamLinks: any[] = [];
|
const streamLinks: any[] = [];
|
||||||
const vLinkRes = await axios(`${link}`, { headers, signal });
|
const vLinkRes = await axios(`${link}`, { headers, signal });
|
||||||
@@ -38,7 +60,8 @@ export async function hubcloudExtractor(
|
|||||||
signal,
|
signal,
|
||||||
redirect: "follow",
|
redirect: "follow",
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(await vcloudRes.text());
|
const vcloudText = await vcloudRes.text();
|
||||||
|
const $ = cheerio.load(vcloudText);
|
||||||
// console.log('vcloudRes', $.text());
|
// console.log('vcloudRes', $.text());
|
||||||
|
|
||||||
const linkClass = $(".btn-success.btn-lg.h6,.btn-danger,.btn-secondary");
|
const linkClass = $(".btn-success.btn-lg.h6,.btn-danger,.btn-secondary");
|
||||||
@@ -48,10 +71,23 @@ export async function hubcloudExtractor(
|
|||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case link?.includes("pixeld"):
|
case link?.includes("pixeld"):
|
||||||
|
console.log("Pixeldrain link found:", link);
|
||||||
if (!link?.includes("api")) {
|
if (!link?.includes("api")) {
|
||||||
const token = link.split("/").pop();
|
const redirectedPixelDrainUrl = getRedirectedPixelDrainUrl(
|
||||||
|
vLinkText,
|
||||||
|
vcloudText,
|
||||||
|
);
|
||||||
|
if (redirectedPixelDrainUrl) {
|
||||||
|
console.log(
|
||||||
|
"Special case for token negn6f",
|
||||||
|
redirectedPixelDrainUrl,
|
||||||
|
);
|
||||||
|
link = redirectedPixelDrainUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
const token = link.split("/").pop()?.split("?")[0];
|
||||||
const baseUrl = link.split("/").slice(0, -2).join("/");
|
const baseUrl = link.split("/").slice(0, -2).join("/");
|
||||||
link = `${baseUrl}/api/file/${token}?download`;
|
link = `${baseUrl}/api/file/${token}`;
|
||||||
}
|
}
|
||||||
streamLinks.push({ server: "Pixeldrain", link: link, type: "mkv" });
|
streamLinks.push({ server: "Pixeldrain", link: link, type: "mkv" });
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ export async function getStream({
|
|||||||
}) {
|
}) {
|
||||||
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
const { axios, cheerio, commonHeaders: headers } = providerContext;
|
||||||
let hubdriveLink = "";
|
let hubdriveLink = "";
|
||||||
|
if (link.includes("hubcloud") || link.includes("/drive/")) {
|
||||||
|
return await hubcloudExtractor(link, signal, axios, cheerio, headers);
|
||||||
|
}
|
||||||
if (link.includes("hubdrive")) {
|
if (link.includes("hubdrive")) {
|
||||||
const hubdriveRes = await axios.get(link, { headers, signal });
|
const hubdriveRes = await axios.get(link, { headers, signal });
|
||||||
const hubdriveText = hubdriveRes.data;
|
const hubdriveText = hubdriveRes.data;
|
||||||
@@ -23,8 +26,8 @@ export async function getStream({
|
|||||||
const res = await axios.get(link, { headers, signal });
|
const res = await axios.get(link, { headers, signal });
|
||||||
const text = res.data;
|
const text = res.data;
|
||||||
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
|
const encryptedString = text.split("s('o','")?.[1]?.split("',180")?.[0];
|
||||||
const decodedString: any = decodeString(encryptedString);
|
const decodedString: any = decodeString(encryptedString) || link;
|
||||||
link = atob(decodedString?.o);
|
link = safeAtob(decodedString?.o) || link;
|
||||||
const redirectLink = await getRedirectLinks(link, signal, headers);
|
const redirectLink = await getRedirectLinks(link, signal, headers);
|
||||||
const redirectLinkRes = await axios.get(redirectLink, { headers, signal });
|
const redirectLinkRes = await axios.get(redirectLink, { headers, signal });
|
||||||
const redirectLinkText = redirectLinkRes.data;
|
const redirectLinkText = redirectLinkRes.data;
|
||||||
@@ -40,11 +43,12 @@ export async function getStream({
|
|||||||
const hubdriveText = hubdriveRes.data;
|
const hubdriveText = hubdriveRes.data;
|
||||||
const $$ = cheerio.load(hubdriveText);
|
const $$ = cheerio.load(hubdriveText);
|
||||||
hubdriveLink =
|
hubdriveLink =
|
||||||
$$(".btn.btn-primary.btn-user").attr("href") || hubdriveLink;
|
$$(".btn.btn-primary.btn-user.btn-success1").attr("href") || "";
|
||||||
}
|
}
|
||||||
console.log("hubdriveLink2", hubdriveLink);
|
console.log("hubdriveLink2", hubdriveLink);
|
||||||
}
|
}
|
||||||
let hubcloudLink = hubdriveLink;
|
let hubcloudLink = hubdriveLink;
|
||||||
|
console.log("hubdriveLink3", hubdriveLink);
|
||||||
try {
|
try {
|
||||||
const hubdriveLinkRes = await axios.get(hubdriveLink, { headers, signal });
|
const hubdriveLinkRes = await axios.get(hubdriveLink, { headers, signal });
|
||||||
const hubcloudText = hubdriveLinkRes.data;
|
const hubcloudText = hubdriveLinkRes.data;
|
||||||
@@ -173,6 +177,14 @@ function rot13(str: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const safeAtob = (str: string) => {
|
||||||
|
try {
|
||||||
|
return atob(str);
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export function decodeString(encryptedString: string) {
|
export function decodeString(encryptedString: string) {
|
||||||
try {
|
try {
|
||||||
// First base64 decode
|
// First base64 decode
|
||||||
|
|||||||
+102
-39
@@ -40,42 +40,103 @@ export const getMeta = async ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(response.data);
|
const $ = cheerio.load(response.data);
|
||||||
const infoContainer = $(".entry-content,.post-inner");
|
const infoContainer = $(
|
||||||
const heading = infoContainer?.find("h3");
|
".entry-content, .post-inner, .post-content, .page-body",
|
||||||
const imdbId =
|
);
|
||||||
//@ts-ignore
|
|
||||||
heading?.next("p")?.find("a")?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] ||
|
|
||||||
infoContainer.text().match(/tt\d+/g)?.[0] ||
|
|
||||||
"";
|
|
||||||
// console.log(imdbId)
|
|
||||||
|
|
||||||
const type = heading?.next("p")?.text()?.includes("Series Name")
|
|
||||||
? "series"
|
|
||||||
: "movie";
|
|
||||||
// console.log(type);
|
|
||||||
// title
|
// title
|
||||||
const titleRegex = /Name: (.+)/;
|
let title = $("h1.post-title").text().trim();
|
||||||
const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
|
if (!title) {
|
||||||
|
const heading = infoContainer?.find("h3");
|
||||||
|
const titleRegex = /Name: (.+)/;
|
||||||
|
title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
|
||||||
|
}
|
||||||
// console.log(title);
|
// console.log(title);
|
||||||
|
|
||||||
|
// imdbId
|
||||||
|
let imdbId =
|
||||||
|
$('a[href*="imdb.com"]').attr("href")?.match(/tt\d+/)?.[0] || "";
|
||||||
|
if (!imdbId) {
|
||||||
|
const heading = infoContainer?.find("h3");
|
||||||
|
imdbId =
|
||||||
|
//@ts-ignore
|
||||||
|
heading
|
||||||
|
?.next("p")
|
||||||
|
?.find("a")?.[0]
|
||||||
|
?.attribs?.href?.match(/tt\d+/g)?.[0] ||
|
||||||
|
infoContainer.text().match(/tt\d+/g)?.[0] ||
|
||||||
|
"";
|
||||||
|
}
|
||||||
|
// console.log(imdbId)
|
||||||
|
|
||||||
|
// type
|
||||||
|
let type = "movie";
|
||||||
|
|
||||||
|
const heading = infoContainer?.find("h3");
|
||||||
|
if (heading?.next("p")?.text()?.includes("Series Name")) {
|
||||||
|
type = "series";
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(type);
|
||||||
|
|
||||||
// synopsis
|
// synopsis
|
||||||
const synopsisNode = //@ts-ignore
|
let synopsis = "";
|
||||||
infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
|
const synopsisHeader = $("h3").filter(
|
||||||
const synopsis =
|
(i, el) =>
|
||||||
synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
|
$(el).text().includes("SYNOPSIS/PLOT") || $(el).text().includes("Plot"),
|
||||||
|
);
|
||||||
|
if (synopsisHeader.length > 0) {
|
||||||
|
synopsis = synopsisHeader.next("p").text().trim();
|
||||||
|
}
|
||||||
|
if (!synopsis) {
|
||||||
|
const synopsisNode = //@ts-ignore
|
||||||
|
infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
|
||||||
|
synopsis =
|
||||||
|
synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
|
||||||
|
}
|
||||||
// console.log(synopsis);
|
// console.log(synopsis);
|
||||||
|
|
||||||
// image
|
// image
|
||||||
let image =
|
let image =
|
||||||
infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || "";
|
infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") ||
|
||||||
|
infoContainer
|
||||||
|
?.find("img")
|
||||||
|
?.filter((i, el) => {
|
||||||
|
const src = $(el).attr("src");
|
||||||
|
return (
|
||||||
|
!!src &&
|
||||||
|
!src.includes("logo") &&
|
||||||
|
!src.includes("svg") &&
|
||||||
|
!src.includes("placeholder") &&
|
||||||
|
!src.includes("icon")
|
||||||
|
);
|
||||||
|
})
|
||||||
|
?.first()
|
||||||
|
?.attr("src") ||
|
||||||
|
"";
|
||||||
|
|
||||||
if (image.startsWith("//")) {
|
if (image.startsWith("//")) {
|
||||||
image = "https:" + image;
|
image = "https:" + image;
|
||||||
}
|
}
|
||||||
// console.log(image);
|
// console.log(image);
|
||||||
|
|
||||||
// console.log({title, synopsis, image, imdbId, type});
|
console.log({ title, synopsis, image, imdbId, type });
|
||||||
/// Links
|
/// Links
|
||||||
const hr = infoContainer?.first()?.find("hr");
|
let hr = infoContainer?.first()?.find("hr");
|
||||||
|
|
||||||
|
// Try to find the HR before the download buttons if possible
|
||||||
|
const firstButton = $(".dwd-button").first();
|
||||||
|
if (firstButton.length > 0) {
|
||||||
|
const containerP = firstButton.closest("p");
|
||||||
|
let prev = containerP.prev();
|
||||||
|
while (prev.length && !prev.is("hr")) {
|
||||||
|
prev = prev.prev();
|
||||||
|
}
|
||||||
|
if (prev.is("hr")) {
|
||||||
|
hr = prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const list = hr?.nextUntil("hr");
|
const list = hr?.nextUntil("hr");
|
||||||
const links: Link[] = [];
|
const links: Link[] = [];
|
||||||
list.each((index, element: any) => {
|
list.each((index, element: any) => {
|
||||||
@@ -86,39 +147,41 @@ export const getMeta = async ({
|
|||||||
const quality = element?.text().match(/\d+p\b/)?.[0] || "";
|
const quality = element?.text().match(/\d+p\b/)?.[0] || "";
|
||||||
// console.log(title);
|
// console.log(title);
|
||||||
// movieLinks
|
// movieLinks
|
||||||
const movieLinks = element
|
const movieLinks =
|
||||||
?.next()
|
element
|
||||||
.find(".dwd-button")
|
?.next()
|
||||||
.text()
|
.find(".dwd-button")
|
||||||
.toLowerCase()
|
.text()
|
||||||
.includes("download")
|
.toLowerCase()
|
||||||
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
.includes("download") ||
|
||||||
: "";
|
element.next().find("a").text().toLowerCase().includes("download")
|
||||||
|
? element?.next().find(".dwd-button")?.parent()?.attr("href") ||
|
||||||
|
element?.next().find("a[href]")?.attr("href")
|
||||||
|
: "";
|
||||||
|
|
||||||
// episode links
|
// episode links
|
||||||
const vcloudLinks = element
|
const vcloudLinks = element
|
||||||
?.next()
|
?.next()
|
||||||
.find(
|
.find(
|
||||||
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;']"
|
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152);color: white']",
|
||||||
)
|
)
|
||||||
?.parent()
|
?.parent()
|
||||||
?.attr("href");
|
?.attr("href");
|
||||||
console.log(title);
|
|
||||||
const episodesLink =
|
const episodesLink =
|
||||||
(vcloudLinks
|
(vcloudLinks
|
||||||
? vcloudLinks
|
? vcloudLinks
|
||||||
: element
|
: element
|
||||||
?.next()
|
?.next()
|
||||||
.find(".dwd-button")
|
.find(".dwd-button")
|
||||||
.text()
|
.text()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes("episode")
|
.includes("episode")
|
||||||
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
||||||
: "") ||
|
: "") ||
|
||||||
element
|
element
|
||||||
?.next()
|
?.next()
|
||||||
.find(
|
.find(
|
||||||
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']"
|
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']",
|
||||||
)
|
)
|
||||||
?.parent()
|
?.parent()
|
||||||
?.attr("href");
|
?.attr("href");
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ export const getPosts = async ({
|
|||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
providerContext: ProviderContext;
|
providerContext: ProviderContext;
|
||||||
}): Promise<Post[]> => {
|
}): Promise<Post[]> => {
|
||||||
const { getBaseUrl } = providerContext;
|
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||||
const baseUrl = await getBaseUrl("lux");
|
const baseUrl = await getBaseUrl("lux");
|
||||||
|
|
||||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||||
const url = `${baseUrl}/${filter}/page/${page}/`;
|
const url = `${baseUrl}/${filter}/page/${page}/`;
|
||||||
console.log("lux url:", url);
|
console.log("vegaGetPosts url:", url);
|
||||||
return posts(url, signal, providerContext);
|
return posts(baseUrl, url, signal, headers, axios, cheerio);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getSearchPosts = async ({
|
export const getSearchPosts = async ({
|
||||||
@@ -56,58 +56,97 @@ export const getSearchPosts = async ({
|
|||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
providerContext: ProviderContext;
|
providerContext: ProviderContext;
|
||||||
}): Promise<Post[]> => {
|
}): Promise<Post[]> => {
|
||||||
const { getBaseUrl } = providerContext;
|
const { getBaseUrl, axios, cheerio } = providerContext;
|
||||||
const baseUrl = await getBaseUrl("lux");
|
const baseUrl = await getBaseUrl("Vega");
|
||||||
|
|
||||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||||
const url =
|
const url = `${baseUrl}/search.php?q=${searchQuery}&page=${page}`;
|
||||||
page === 1
|
console.log("vegaGetPosts url:", url);
|
||||||
? `https://c.8man.workers.dev/?url=${baseUrl}/?s=${searchQuery}`
|
|
||||||
: `https://c.8man.workers.dev/?url=${baseUrl}/page/${page}/?s=${searchQuery}`;
|
|
||||||
console.log("lux url:", url);
|
|
||||||
|
|
||||||
return posts(url, signal, providerContext);
|
try {
|
||||||
|
const response = await axios.get(url, {
|
||||||
|
headers: {
|
||||||
|
...headers,
|
||||||
|
Referer: baseUrl,
|
||||||
|
},
|
||||||
|
signal,
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
const posts: Post[] = [];
|
||||||
|
|
||||||
|
if (data?.hits) {
|
||||||
|
data.hits.forEach((hit: any) => {
|
||||||
|
const doc = hit.document;
|
||||||
|
const post = {
|
||||||
|
title: doc.post_title.replace("Download", "").trim(),
|
||||||
|
link: doc.permalink.startsWith("http")
|
||||||
|
? doc.permalink
|
||||||
|
: `${baseUrl}${doc.permalink}`,
|
||||||
|
image: doc.post_thumbnail,
|
||||||
|
};
|
||||||
|
posts.push(post);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return posts;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("vegaGetSearchPosts error:", error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function posts(
|
async function posts(
|
||||||
|
baseUrl: string,
|
||||||
url: string,
|
url: string,
|
||||||
signal: AbortSignal,
|
signal: AbortSignal,
|
||||||
providerContext: ProviderContext
|
headers: Record<string, string> = {},
|
||||||
|
axios: ProviderContext["axios"],
|
||||||
|
cheerio: ProviderContext["cheerio"],
|
||||||
): Promise<Post[]> {
|
): Promise<Post[]> {
|
||||||
try {
|
try {
|
||||||
const { axios, cheerio } = providerContext;
|
|
||||||
const urlRes = await fetch(url, {
|
const urlRes = await fetch(url, {
|
||||||
headers: {
|
headers: {
|
||||||
...headers,
|
...headers,
|
||||||
Referer: url,
|
Referer: baseUrl,
|
||||||
},
|
},
|
||||||
signal,
|
signal,
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(await urlRes.text());
|
const $ = cheerio.load(await urlRes.text());
|
||||||
const posts: Post[] = [];
|
const posts: Post[] = [];
|
||||||
$(".blog-items")
|
$(".blog-items,.post-list,#archive-container,.movies-grid")
|
||||||
?.children("article")
|
?.children("article,.entry-list-item,a")
|
||||||
?.each((index, element) => {
|
?.each((index, element) => {
|
||||||
const post = {
|
const post = {
|
||||||
title:
|
title: (
|
||||||
$(element)
|
$(element)
|
||||||
?.find("a")
|
?.find(".entry-title,.poster-title")
|
||||||
?.attr("title")
|
?.text()
|
||||||
?.replace("Download", "")
|
?.replace("Download", "")
|
||||||
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
|
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
|
||||||
$(element)?.find("a")?.attr("title")?.replace("Download", "") ||
|
$(element)?.find("a")?.attr("title")?.replace("Download", "") ||
|
||||||
"",
|
$(element)
|
||||||
|
?.find(".post-title,.poster-title")
|
||||||
|
.text()
|
||||||
|
?.replace("Download", "") ||
|
||||||
|
""
|
||||||
|
).trim(),
|
||||||
|
|
||||||
link: $(element)?.find("a")?.attr("href") || "",
|
link:
|
||||||
|
$(element)?.find("a")?.attr("href") ||
|
||||||
|
$(element)?.attr("href") ||
|
||||||
|
"",
|
||||||
image:
|
image:
|
||||||
$(element).find("a").find("img").attr("data-lazy-src") ||
|
$(element).find("a").find("img").attr("data-lazy-src") ||
|
||||||
$(element).find("a").find("img").attr("data-src") ||
|
$(element).find("a").find("img").attr("data-src") ||
|
||||||
$(element).find("a").find("img").attr("src") ||
|
$(element).find("a").find("img").attr("src") ||
|
||||||
|
$(element).find("img").attr("data-src") ||
|
||||||
|
$(element).find("img").attr("src") ||
|
||||||
"",
|
"",
|
||||||
};
|
};
|
||||||
if (post.image.startsWith("//")) {
|
if (post.image.startsWith("//")) {
|
||||||
post.image = "https:" + post.image;
|
post.image = "https:" + post.image;
|
||||||
}
|
}
|
||||||
|
console.log("vegaGetPosts post:", post);
|
||||||
posts.push(post);
|
posts.push(post);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
export const catalog = [
|
export const catalog = [
|
||||||
{
|
{
|
||||||
title: "Trending",
|
title: "Latest",
|
||||||
filter: "",
|
filter: "",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Anime",
|
title: "Web Series",
|
||||||
filter: "/category/anime/",
|
filter: "/category/web-series/",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
+106
-34
@@ -1,6 +1,6 @@
|
|||||||
import { EpisodeLink, ProviderContext } from "../types";
|
import { EpisodeLink, ProviderContext } from "../types";
|
||||||
|
|
||||||
// यहाँ `getEpisodes` फ़ंक्शन मान रहा है कि यह उस पेज को स्क्रैप कर रहा है
|
// यहाँ `getEpisodes` फ़ंक्शन मान रहा है कि यह उस पेज को स्क्रैप कर रहा है
|
||||||
// जो 'Download Links' बटन से प्राप्त हुआ है (जैसे m4ulinks.com/number/42882)
|
// जो 'Download Links' बटन से प्राप्त हुआ है (जैसे m4ulinks.com/number/42882)
|
||||||
|
|
||||||
export const getEpisodes = async function ({
|
export const getEpisodes = async function ({
|
||||||
@@ -14,7 +14,7 @@ export const getEpisodes = async function ({
|
|||||||
console.log("getEpisodeLinks", url);
|
console.log("getEpisodeLinks", url);
|
||||||
try {
|
try {
|
||||||
// Note: Cookies को URL के आधार पर अपडेट करने की आवश्यकता हो सकती है
|
// Note: Cookies को URL के आधार पर अपडेट करने की आवश्यकता हो सकती है
|
||||||
const res = await axios.get(url, {
|
let res = await axios.get(url, {
|
||||||
headers: {
|
headers: {
|
||||||
...headers,
|
...headers,
|
||||||
// Cloudflare/Bot protection के लिए Hardcoded cookie यहाँ आवश्यक हो सकता है
|
// Cloudflare/Bot protection के लिए Hardcoded cookie यहाँ आवश्यक हो सकता है
|
||||||
@@ -22,43 +22,115 @@ export const getEpisodes = async function ({
|
|||||||
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t",
|
"ext_name=ojplmecpdpgccookcobabopnaifgidhf; cf_clearance=Zl2yiOCN3pzGUd0Bgs.VyBXniJooDbG2Tk1g7DEoRnw-1756381111-1.2.1.1-RVPZoWGCAygGNAHavrVR0YaqASWZlJyYff8A.oQfPB5qbcPrAVud42BzsSwcDgiKAP0gw5D92V3o8XWwLwDRNhyg3DuL1P8wh2K4BCVKxWvcy.iCCxczKtJ8QSUAsAQqsIzRWXk29N6X.kjxuOTYlfB2jrlq12TRDld_zTbsskNcTxaA.XQekUcpGLseYqELuvlNOQU568NZD6LiLn3ICyFThMFAx6mIcgXkxVAvnxU; xla=s4t",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(res.data);
|
|
||||||
const container = $(".entry-content,.entry-inner, .download-links-div");
|
|
||||||
|
|
||||||
// .unili-content,.code-block-1 जैसे अवांछित तत्वों को हटा दें
|
|
||||||
$(".unili-content,.code-block-1").remove();
|
|
||||||
|
|
||||||
const episodes: EpisodeLink[] = [];
|
|
||||||
|
|
||||||
// HubCloud Links को लक्षित करने के लिए:
|
if (
|
||||||
// 1. Episode Title (h5) से शुरू करें
|
res.data &&
|
||||||
// 2. उसके बाद के downloads-btns-div में HubCloud बटन खोजें
|
res.data.includes("Please turn JavaScript on and reload the page.")
|
||||||
|
) {
|
||||||
container.find("h5").each((index, element) => {
|
const b1Match = res.data.match(/var b1=atob\(['"]([^'"]+)['"]\)/);
|
||||||
const el = $(element);
|
const a2Match = res.data.match(/_0x2aa8=\[['"]([^'"]+)['"]\]/);
|
||||||
const title = el.text().trim(); // e.g., "-:Episodes: 1:- (Grand Premiere)"
|
const c3Match = res.data.match(/c3=toNumbers\(['"]([^'"]+)['"]\)/);
|
||||||
|
|
||||||
// HubCloud लिंक को विशिष्ट स्टाइल और टेक्स्ट से खोजें
|
|
||||||
// बटन सेलेक्टर: style="background: linear-gradient(135deg,#e629d0,#007bff);color: white;"
|
|
||||||
const hubCloudLink = el
|
|
||||||
.next(".downloads-btns-div")
|
|
||||||
.find(
|
|
||||||
'a[style*="background: linear-gradient(135deg,#e629d0,#007bff);"]'
|
|
||||||
)
|
|
||||||
.attr("href");
|
|
||||||
|
|
||||||
if (title && hubCloudLink) {
|
if (b1Match && a2Match && c3Match) {
|
||||||
// टाइटल को साफ़ करें (e.g., सिर्फ़ Episode 1: Grand Premiere रखें)
|
const unescapeHexStr = (str: string) =>
|
||||||
const cleanedTitle = title.replace(/[-:]/g, "").trim();
|
str.replace(/\\x([0-9A-Fa-f]{2})/g, (_, hex) =>
|
||||||
|
String.fromCharCode(parseInt(hex, 16)),
|
||||||
episodes.push({
|
);
|
||||||
title: cleanedTitle,
|
|
||||||
link: hubCloudLink,
|
const baseUrl = url.split("/").slice(0, 3).join("/");
|
||||||
// यदि यह HubCloud/Streaming लिंक है, तो आप 'type' को यहाँ 'stream' भी सेट कर सकते हैं
|
const minJsRes = await axios.get(`${baseUrl}/min.js`, {
|
||||||
|
headers,
|
||||||
|
});
|
||||||
|
|
||||||
|
const b1Hex = atob(unescapeHexStr(b1Match[1]));
|
||||||
|
const a2Hex = atob(unescapeHexStr(a2Match[1]));
|
||||||
|
const c3Hex = unescapeHexStr(c3Match[1]);
|
||||||
|
|
||||||
|
const solver = new Function(
|
||||||
|
"c3Hex",
|
||||||
|
"a1Hex",
|
||||||
|
"b2Hex",
|
||||||
|
`
|
||||||
|
${minJsRes.data}
|
||||||
|
function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}
|
||||||
|
function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e='',f=0;f<d.length;f++)e+=(16>d[f]?'0':'')+d[f].toString(16);return e.toLowerCase()}
|
||||||
|
return toHex(slowAES.decrypt(toNumbers(c3Hex), 2, toNumbers(a1Hex), toNumbers(b2Hex)));
|
||||||
|
`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const decrypted = solver(c3Hex, a2Hex, b1Hex);
|
||||||
|
const newCookie = `Antiddos-systems-DH=${decrypted}`;
|
||||||
|
|
||||||
|
res = await axios.get(url, {
|
||||||
|
headers: { ...headers, Cookie: newCookie },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const $ = cheerio.load(res.data);
|
||||||
|
const container = $(".entry-content,.entry-inner, .download-links-div");
|
||||||
|
|
||||||
|
// .unili-content,.code-block-1 जैसे अवांछित तत्वों को हटा दें
|
||||||
|
$(".unili-content,.code-block-1").remove();
|
||||||
|
|
||||||
|
const episodes: EpisodeLink[] = [];
|
||||||
|
|
||||||
|
// The site changed its layout. Links are now inside <p> tags following <h3> or <h4> tags with quality info.
|
||||||
|
// We can also just look for the <a> tags directly and find their preceding quality headers.
|
||||||
|
const hElements = container.find("h3, h4, h5, p");
|
||||||
|
|
||||||
|
hElements.each((index, element) => {
|
||||||
|
const el = $(element);
|
||||||
|
const title = el.text().trim();
|
||||||
|
|
||||||
|
// The download buttons are usually in the next <p> tag
|
||||||
|
const downloadButtons = el.nextAll().find("a").first();
|
||||||
|
const link = downloadButtons.attr("href");
|
||||||
|
|
||||||
|
if (
|
||||||
|
title &&
|
||||||
|
link &&
|
||||||
|
title.match(/Episode|Ep|E\d+/i) &&
|
||||||
|
title.length < 150
|
||||||
|
) {
|
||||||
|
// Clean up the title
|
||||||
|
const cleanedTitle = title.replace(/[-:]/g, "").trim();
|
||||||
|
|
||||||
|
// Deduplicate
|
||||||
|
if (!episodes.some((e) => e.link === link)) {
|
||||||
|
episodes.push({
|
||||||
|
title: cleanedTitle,
|
||||||
|
link: link,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Fallback: if no episodes found by heading, just grab all mdrive/fastdl links
|
||||||
|
if (episodes.length === 0) {
|
||||||
|
$("a").each((i, el) => {
|
||||||
|
const href = $(el).attr("href");
|
||||||
|
if (
|
||||||
|
href &&
|
||||||
|
(href.includes("mdrive") ||
|
||||||
|
href.includes("fastdl") ||
|
||||||
|
href.includes("filebee") ||
|
||||||
|
href.includes("gdflix"))
|
||||||
|
) {
|
||||||
|
const title =
|
||||||
|
$(el).parent().prev().text().trim() ||
|
||||||
|
$(el).text().trim() ||
|
||||||
|
`Episode ${i + 1}`;
|
||||||
|
if (!episodes.some((e) => e.link === href)) {
|
||||||
|
episodes.push({
|
||||||
|
title: title.replace(/[-:]/g, "").trim(),
|
||||||
|
link: href,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// console.log(episodes);
|
// console.log(episodes);
|
||||||
return episodes;
|
return episodes;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -66,4 +138,4 @@ export const getEpisodes = async function ({
|
|||||||
// console.error(err);
|
// console.error(err);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+69
-27
@@ -43,10 +43,53 @@ export const getMeta = async function ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(url, {
|
let response = await axios.get(url, {
|
||||||
headers: { ...headers, Referer: baseUrl },
|
headers: { ...headers, Referer: baseUrl },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (
|
||||||
|
response.data &&
|
||||||
|
response.data.includes("Please turn JavaScript on and reload the page.")
|
||||||
|
) {
|
||||||
|
const b1Match = response.data.match(/var b1=atob\(['"]([^'"]+)['"]\)/);
|
||||||
|
const a2Match = response.data.match(/_0x2aa8=\[['"]([^'"]+)['"]\]/);
|
||||||
|
const c3Match = response.data.match(/c3=toNumbers\(['"]([^'"]+)['"]\)/);
|
||||||
|
|
||||||
|
if (b1Match && a2Match && c3Match) {
|
||||||
|
const unescapeHexStr = (str: string) =>
|
||||||
|
str.replace(/\\x([0-9A-Fa-f]{2})/g, (_, hex) =>
|
||||||
|
String.fromCharCode(parseInt(hex, 16)),
|
||||||
|
);
|
||||||
|
|
||||||
|
const minJsRes = await axios.get(`${baseUrl}/min.js`, {
|
||||||
|
headers: { ...headers, Referer: baseUrl },
|
||||||
|
});
|
||||||
|
|
||||||
|
const b1Hex = atob(unescapeHexStr(b1Match[1]));
|
||||||
|
const a2Hex = atob(unescapeHexStr(a2Match[1]));
|
||||||
|
const c3Hex = unescapeHexStr(c3Match[1]);
|
||||||
|
|
||||||
|
const solver = new Function(
|
||||||
|
"c3Hex",
|
||||||
|
"a1Hex",
|
||||||
|
"b2Hex",
|
||||||
|
`
|
||||||
|
${minJsRes.data}
|
||||||
|
function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}
|
||||||
|
function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e='',f=0;f<d.length;f++)e+=(16>d[f]?'0':'')+d[f].toString(16);return e.toLowerCase()}
|
||||||
|
return toHex(slowAES.decrypt(toNumbers(c3Hex), 2, toNumbers(a1Hex), toNumbers(b2Hex)));
|
||||||
|
`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const decrypted = solver(c3Hex, a2Hex, b1Hex);
|
||||||
|
const newCookie = `Antiddos-systems-DH=${decrypted}`;
|
||||||
|
|
||||||
|
response = await axios.get(url, {
|
||||||
|
headers: { ...headers, Referer: baseUrl, Cookie: newCookie },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const $ = cheerio.load(response.data);
|
const $ = cheerio.load(response.data);
|
||||||
const infoContainer = $(".entry-content, .post-inner").length
|
const infoContainer = $(".entry-content, .post-inner").length
|
||||||
? $(".entry-content, .post-inner")
|
? $(".entry-content, .post-inner")
|
||||||
@@ -100,29 +143,23 @@ export const getMeta = async function ({
|
|||||||
image = "";
|
image = "";
|
||||||
result.image = image;
|
result.image = image;
|
||||||
|
|
||||||
// --- Synopsis ---
|
|
||||||
result.synopsis =
|
|
||||||
$("h3.movie-title")
|
|
||||||
.filter((i, el) => $(el).text().includes("Storyline"))
|
|
||||||
.next("p")
|
|
||||||
.text()
|
|
||||||
.trim() ||
|
|
||||||
infoContainer.find("p").first().text().trim() ||
|
|
||||||
"";
|
|
||||||
|
|
||||||
// --- LinkList extraction ---
|
// --- LinkList extraction ---
|
||||||
const links: Link[] = [];
|
const links: Link[] = [];
|
||||||
const h4Elements = $(".download-links-div").find("> h4");
|
|
||||||
|
|
||||||
h4Elements.each((index, element) => {
|
// The site changed its layout. Links are now inside <p> tags following <h3> or <h4> tags with quality info.
|
||||||
|
// We can also just look for the <a> tags directly and find their preceding quality headers.
|
||||||
|
const hElements = infoContainer.find("h3, h4, p");
|
||||||
|
|
||||||
|
hElements.each((index, element) => {
|
||||||
const el = $(element);
|
const el = $(element);
|
||||||
const titleText = el.text().trim();
|
const titleText = el.text().trim();
|
||||||
const qualityMatch = titleText.match(/\d+p\b/)?.[0];
|
const qualityMatch = titleText.match(/\d+p\b/)?.[0];
|
||||||
const fullTitle = titleText;
|
const fullTitle = titleText;
|
||||||
|
|
||||||
const downloadButtons = el.next(".downloads-btns-div").find("a");
|
// The download buttons are usually in the next <p> tag
|
||||||
|
const downloadButtons = el.nextAll().find("a").first();
|
||||||
|
|
||||||
if (downloadButtons.length && qualityMatch) {
|
if (downloadButtons.length && qualityMatch && titleText.length < 350) {
|
||||||
if (result.type === "series") {
|
if (result.type === "series") {
|
||||||
links.push({
|
links.push({
|
||||||
title: fullTitle,
|
title: fullTitle,
|
||||||
@@ -134,17 +171,14 @@ export const getMeta = async function ({
|
|||||||
// Movie: collect all direct download buttons
|
// Movie: collect all direct download buttons
|
||||||
const directLinks: Link["directLinks"] = [];
|
const directLinks: Link["directLinks"] = [];
|
||||||
|
|
||||||
downloadButtons.each((i, btn) => {
|
const link = downloadButtons.attr("href");
|
||||||
const btnEl = $(btn);
|
if (link) {
|
||||||
const link = btnEl.attr("href");
|
directLinks.push({
|
||||||
if (link) {
|
title: downloadButtons.text().trim() || "Download",
|
||||||
directLinks.push({
|
link,
|
||||||
title: btnEl.text().trim() || "Download",
|
type: "movie", // literal type
|
||||||
link,
|
});
|
||||||
type: "movie", // literal type
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (directLinks.length) {
|
if (directLinks.length) {
|
||||||
links.push({
|
links.push({
|
||||||
@@ -158,7 +192,15 @@ export const getMeta = async function ({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
result.linkList = links;
|
// Deduplicate links by href
|
||||||
|
const uniqueLinks = new Map<string, Link>();
|
||||||
|
links.forEach((link) => {
|
||||||
|
const href = link.episodesLink || link.directLinks?.[0]?.link;
|
||||||
|
if (href && !uniqueLinks.has(href)) {
|
||||||
|
uniqueLinks.set(href, link);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result.linkList = Array.from(uniqueLinks.values());
|
||||||
return result;
|
return result;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("getMeta error:", err);
|
console.log("getMeta error:", err);
|
||||||
|
|||||||
+80
-11
@@ -1,14 +1,23 @@
|
|||||||
import { Post, ProviderContext } from "../types";
|
import { Post, ProviderContext } from "../types";
|
||||||
|
|
||||||
const defaultHeaders = {
|
const defaultHeaders = {
|
||||||
Referer: "https://www.google.com",
|
accept:
|
||||||
"User-Agent":
|
"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",
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " +
|
"accept-language": "en-US,en;q=0.9",
|
||||||
"(KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36",
|
"cache-control": "no-cache",
|
||||||
Accept: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
pragma: "no-cache",
|
||||||
"Accept-Language": "en-US,en;q=0.9",
|
priority: "u=0, i",
|
||||||
Pragma: "no-cache",
|
"sec-ch-ua":
|
||||||
"Cache-Control": "no-cache",
|
'"Microsoft Edge";v="147", "Not.A/Brand";v="8", "Chromium";v="147"',
|
||||||
|
"sec-ch-ua-mobile": "?0",
|
||||||
|
"sec-ch-ua-platform": '"Windows"',
|
||||||
|
"sec-fetch-dest": "document",
|
||||||
|
"sec-fetch-mode": "navigate",
|
||||||
|
"sec-fetch-site": "same-origin",
|
||||||
|
"sec-fetch-user": "?1",
|
||||||
|
"upgrade-insecure-requests": "1",
|
||||||
|
cookie: "Antiddos-systems-DH=395a53ac840ad21dff778291a3ffae36",
|
||||||
|
Referer: "https://movies4u.vg/category/web-series/",
|
||||||
};
|
};
|
||||||
|
|
||||||
// --- Normal catalog posts ---
|
// --- Normal catalog posts ---
|
||||||
@@ -81,7 +90,60 @@ async function fetchPosts({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { axios, cheerio } = providerContext;
|
const { axios, cheerio } = providerContext;
|
||||||
const res = await axios.get(url, { headers: defaultHeaders, signal });
|
let res = await axios.get(url, {
|
||||||
|
headers: defaultHeaders,
|
||||||
|
signal,
|
||||||
|
maxRedirects: 5,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Anti-DDoS-Guard check
|
||||||
|
if (
|
||||||
|
res.data &&
|
||||||
|
res.data.includes("Please turn JavaScript on and reload the page.")
|
||||||
|
) {
|
||||||
|
const b1Match = res.data.match(/var b1=atob\(['"]([^'"]+)['"]\)/);
|
||||||
|
const a2Match = res.data.match(/_0x2aa8=\[['"]([^'"]+)['"]\]/);
|
||||||
|
const c3Match = res.data.match(/c3=toNumbers\(['"]([^'"]+)['"]\)/);
|
||||||
|
|
||||||
|
if (b1Match && a2Match && c3Match) {
|
||||||
|
const unescapeHexStr = (str: string) =>
|
||||||
|
str.replace(/\\x([0-9A-Fa-f]{2})/g, (_, hex) =>
|
||||||
|
String.fromCharCode(parseInt(hex, 16)),
|
||||||
|
);
|
||||||
|
|
||||||
|
// Fetch the min.js payload from the provider to safely execute slowAES
|
||||||
|
const minJsRes = await axios.get(`${baseUrl}/min.js`, {
|
||||||
|
headers: defaultHeaders,
|
||||||
|
signal,
|
||||||
|
});
|
||||||
|
|
||||||
|
const b1Hex = atob(unescapeHexStr(b1Match[1]));
|
||||||
|
const a2Hex = atob(unescapeHexStr(a2Match[1]));
|
||||||
|
const c3Hex = unescapeHexStr(c3Match[1]);
|
||||||
|
|
||||||
|
// Evaluate the decryption without needing crypto or buffers
|
||||||
|
const solver = new Function(
|
||||||
|
"c3Hex",
|
||||||
|
"a1Hex",
|
||||||
|
"b2Hex",
|
||||||
|
`
|
||||||
|
${minJsRes.data}
|
||||||
|
function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}
|
||||||
|
function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e='',f=0;f<d.length;f++)e+=(16>d[f]?'0':'')+d[f].toString(16);return e.toLowerCase()}
|
||||||
|
return toHex(slowAES.decrypt(toNumbers(c3Hex), 2, toNumbers(a1Hex), toNumbers(b2Hex)));
|
||||||
|
`,
|
||||||
|
);
|
||||||
|
|
||||||
|
const decrypted = solver(c3Hex, a2Hex, b1Hex);
|
||||||
|
const newCookie = `Antiddos-systems-DH=${decrypted}`;
|
||||||
|
res = await axios.get(url, {
|
||||||
|
headers: { ...defaultHeaders, Cookie: newCookie },
|
||||||
|
signal,
|
||||||
|
maxRedirects: 5,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const $ = cheerio.load(res.data || "");
|
const $ = cheerio.load(res.data || "");
|
||||||
|
|
||||||
const resolveUrl = (href: string) =>
|
const resolveUrl = (href: string) =>
|
||||||
@@ -100,10 +162,13 @@ async function fetchPosts({
|
|||||||
".thumbnail",
|
".thumbnail",
|
||||||
".latest-movies",
|
".latest-movies",
|
||||||
".movie-item",
|
".movie-item",
|
||||||
|
".entry-card",
|
||||||
].join(",");
|
].join(",");
|
||||||
|
|
||||||
|
console.log("Fetching posts from URL:", url); // Debug log
|
||||||
$(POST_SELECTORS).each((_, el) => {
|
$(POST_SELECTORS).each((_, el) => {
|
||||||
const card = $(el);
|
const card = $(el);
|
||||||
|
console.log("Processing card:", card.text().trim().slice(0, 50)); // Debug log
|
||||||
let link = card.find("a[href]").first().attr("href") || "";
|
let link = card.find("a[href]").first().attr("href") || "";
|
||||||
if (!link) return;
|
if (!link) return;
|
||||||
link = resolveUrl(link);
|
link = resolveUrl(link);
|
||||||
@@ -114,9 +179,13 @@ async function fetchPosts({
|
|||||||
card.find("a[title]").first().attr("title")?.trim() ||
|
card.find("a[title]").first().attr("title")?.trim() ||
|
||||||
card.text().trim();
|
card.text().trim();
|
||||||
title = title
|
title = title
|
||||||
|
.replace(
|
||||||
|
/(?:480p|720p|1080p|4k|HDTC|HDRip|BluRay|LiNE|Full Movie).*$/i,
|
||||||
|
"",
|
||||||
|
)
|
||||||
.replace(/\[.*?\]/g, "")
|
.replace(/\[.*?\]/g, "")
|
||||||
.replace(/\(.+?\)/g, "")
|
|
||||||
.replace(/\s{2,}/g, " ")
|
.replace(/\s{2,}/g, " ")
|
||||||
|
.replace(/\s*[|\-]\s*$/, "")
|
||||||
.trim();
|
.trim();
|
||||||
if (!title) return;
|
if (!title) return;
|
||||||
|
|
||||||
@@ -135,7 +204,7 @@ async function fetchPosts({
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(
|
console.error(
|
||||||
"HDMovie2 fetchPosts error:",
|
"HDMovie2 fetchPosts error:",
|
||||||
err instanceof Error ? err.message : String(err)
|
err instanceof Error ? err.message : String(err),
|
||||||
);
|
);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,50 @@ export async function getStream({
|
|||||||
// console.log('dotlinkText', dotlinkText);
|
// console.log('dotlinkText', dotlinkText);
|
||||||
const vlink = dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i) || [];
|
const vlink = dotlinkText.match(/<a\s+href="([^"]*cloud\.[^"]*)"/i) || [];
|
||||||
// console.log('vLink', vlink[1]);
|
// console.log('vLink', vlink[1]);
|
||||||
link = vlink[1];
|
if (vlink[1]) {
|
||||||
|
link = vlink[1];
|
||||||
|
} else {
|
||||||
|
// Try to find hubcloud or gdflix links directly
|
||||||
|
const $ = cheerio.load(dotlinkText);
|
||||||
|
const directLink = $("a")
|
||||||
|
.filter((i, el) => {
|
||||||
|
const href = $(el).attr("href") || "";
|
||||||
|
return (
|
||||||
|
href.includes("hubcloud") ||
|
||||||
|
href.includes("gdflix") ||
|
||||||
|
href.includes("filebee") ||
|
||||||
|
href.includes("fastdl")
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.first()
|
||||||
|
.attr("href");
|
||||||
|
|
||||||
|
if (directLink) {
|
||||||
|
link = directLink;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's a fastdl link, extract the redirect URL
|
||||||
|
if (link.includes("fastdl.zip")) {
|
||||||
|
try {
|
||||||
|
const fastdlRes = await axios.get(link, { headers });
|
||||||
|
const reurlMatch = fastdlRes.data.match(/var reurl = "([^"]+)";/);
|
||||||
|
if (reurlMatch && reurlMatch[1]) {
|
||||||
|
const actualLink = reurlMatch[1].replace(
|
||||||
|
"https://fastdl.zip/dl.php?link=",
|
||||||
|
"",
|
||||||
|
);
|
||||||
|
streamLinks.push({
|
||||||
|
server: "fastdl",
|
||||||
|
link: actualLink,
|
||||||
|
type: "mkv",
|
||||||
|
});
|
||||||
|
return streamLinks;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("fastdl error: ", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// filepress link
|
// filepress link
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ import { getBaseUrl } from "./getBaseUrl";
|
|||||||
import { headers } from "./headers";
|
import { headers } from "./headers";
|
||||||
import * as cheerio from "cheerio";
|
import * as cheerio from "cheerio";
|
||||||
import { ProviderContext } from "./types";
|
import { ProviderContext } from "./types";
|
||||||
import Aes from "react-native-aes-crypto";
|
|
||||||
|
|
||||||
export const providerContext: ProviderContext = {
|
export const providerContext: ProviderContext = {
|
||||||
axios,
|
axios,
|
||||||
getBaseUrl,
|
getBaseUrl,
|
||||||
|
Aes: null,
|
||||||
commonHeaders: headers,
|
commonHeaders: headers,
|
||||||
Aes,
|
|
||||||
cheerio,
|
cheerio,
|
||||||
};
|
};
|
||||||
|
|||||||
+42
-21
@@ -32,10 +32,17 @@ export const getSearchPosts = async function ({
|
|||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
providerContext: ProviderContext;
|
providerContext: ProviderContext;
|
||||||
}): Promise<Post[]> {
|
}): Promise<Post[]> {
|
||||||
const { getBaseUrl, axios, cheerio } = providerContext;
|
const { getBaseUrl, axios, cheerio, commonHeaders } = providerContext;
|
||||||
const baseUrl = await getBaseUrl("showbox");
|
const baseUrl = await getBaseUrl("showbox");
|
||||||
const url = `${baseUrl}/search?keyword=${searchQuery}&page=${page}`;
|
const url = `${baseUrl}/search?keyword=${searchQuery}&page=${page}`;
|
||||||
return posts({ url, signal, baseUrl, axios, cheerio });
|
return posts({
|
||||||
|
url,
|
||||||
|
signal,
|
||||||
|
baseUrl,
|
||||||
|
axios,
|
||||||
|
cheerio,
|
||||||
|
headers: commonHeaders,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
async function posts({
|
async function posts({
|
||||||
@@ -44,32 +51,46 @@ async function posts({
|
|||||||
// baseUrl,
|
// baseUrl,
|
||||||
axios,
|
axios,
|
||||||
cheerio,
|
cheerio,
|
||||||
|
headers,
|
||||||
}: {
|
}: {
|
||||||
url: string;
|
url: string;
|
||||||
signal: AbortSignal;
|
signal: AbortSignal;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
axios: ProviderContext["axios"];
|
axios: ProviderContext["axios"];
|
||||||
cheerio: ProviderContext["cheerio"];
|
cheerio: ProviderContext["cheerio"];
|
||||||
|
headers?: Record<string, string>;
|
||||||
}): Promise<Post[]> {
|
}): Promise<Post[]> {
|
||||||
try {
|
const maxRetries = 3;
|
||||||
const res = await axios.get(url, { signal });
|
let lastError: unknown;
|
||||||
const data = res.data;
|
|
||||||
const $ = cheerio.load(data);
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
||||||
const catalog: Post[] = [];
|
try {
|
||||||
$(".movie-item,.flw-item").map((i, element) => {
|
const res = await axios.get(url, { signal, headers: headers });
|
||||||
const title = $(element).find(".film-name").text().trim();
|
const data = res.data;
|
||||||
const link = $(element).find("a").attr("href");
|
console.log(data);
|
||||||
const image = $(element).find("img").attr("src");
|
const $ = cheerio.load(data);
|
||||||
if (title && link && image) {
|
const catalog: Post[] = [];
|
||||||
catalog.push({
|
$(".movie-item,.flw-item").map((i, element) => {
|
||||||
title: title,
|
const title = $(element).find(".film-name").text().trim();
|
||||||
link: link,
|
const link = $(element).find("a").attr("href");
|
||||||
image: image,
|
const image = $(element).find("img").attr("src");
|
||||||
});
|
console.log(title, link, image);
|
||||||
|
if (title && link && image) {
|
||||||
|
catalog.push({
|
||||||
|
title: title,
|
||||||
|
link: link,
|
||||||
|
image: image,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return catalog;
|
||||||
|
} catch (err) {
|
||||||
|
lastError = err;
|
||||||
|
if (signal.aborted || attempt === maxRetries) {
|
||||||
|
throw err;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
return catalog;
|
|
||||||
} catch (err) {
|
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw lastError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const getStream = async function ({
|
|||||||
const { axios, cheerio } = providerContext;
|
const { axios, cheerio } = providerContext;
|
||||||
const stream: Stream[] = [];
|
const stream: Stream[] = [];
|
||||||
const [, epId] = id.split("&");
|
const [, epId] = id.split("&");
|
||||||
const url = `https://febbox.vercel.app/api/video-quality?fid=${epId}`;
|
const url = `https://feb.8man.workers.dev/?fid=${epId}`;
|
||||||
const res = await axios.get(url, { signal });
|
const res = await axios.get(url, { signal });
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const $ = cheerio.load(data.html);
|
const $ = cheerio.load(data.html);
|
||||||
@@ -35,6 +35,7 @@ export const getStream = async function ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log(stream);
|
||||||
return stream;
|
return stream;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -12,12 +12,11 @@ const headers = {
|
|||||||
"sec-ch-ua-platform": '"Windows"',
|
"sec-ch-ua-platform": '"Windows"',
|
||||||
"Sec-Fetch-Dest": "document",
|
"Sec-Fetch-Dest": "document",
|
||||||
"Sec-Fetch-Mode": "navigate",
|
"Sec-Fetch-Mode": "navigate",
|
||||||
Cookie: "popads_user_id=6ba8fe60a481387a3249f05aa058822d",
|
|
||||||
"Sec-Fetch-Site": "none",
|
"Sec-Fetch-Site": "none",
|
||||||
"Sec-Fetch-User": "?1",
|
"Sec-Fetch-User": "?1",
|
||||||
"Upgrade-Insecure-Requests": "1",
|
"Upgrade-Insecure-Requests": "1",
|
||||||
"User-Agent":
|
"User-Agent":
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36 Edg/148.0.0.0",
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPosts = async function ({
|
export const getPosts = async function ({
|
||||||
@@ -60,7 +59,7 @@ export const getSearchPosts = async function ({
|
|||||||
async function posts(
|
async function posts(
|
||||||
url: string,
|
url: string,
|
||||||
signal: AbortSignal,
|
signal: AbortSignal,
|
||||||
providerContext: ProviderContext
|
providerContext: ProviderContext,
|
||||||
): Promise<Post[]> {
|
): Promise<Post[]> {
|
||||||
try {
|
try {
|
||||||
const { axios, cheerio } = providerContext;
|
const { axios, cheerio } = providerContext;
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ export const catalog = [
|
|||||||
filter: "web-series/amazon-prime-video",
|
filter: "web-series/amazon-prime-video",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "4K Movies",
|
title: "Apple TV+",
|
||||||
filter: "movies-by-quality/2160p",
|
filter: "web-series/apple-tv",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
+101
-37
@@ -40,34 +40,81 @@ export const getMeta = async ({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(response.data);
|
const $ = cheerio.load(response.data);
|
||||||
const infoContainer = $(".entry-content,.post-inner");
|
const infoContainer = $(
|
||||||
const heading = infoContainer?.find("h3");
|
".entry-content, .post-inner, .post-content, .page-body",
|
||||||
const imdbId =
|
);
|
||||||
//@ts-ignore
|
|
||||||
heading?.next("p")?.find("a")?.[0]?.attribs?.href?.match(/tt\d+/g)?.[0] ||
|
|
||||||
infoContainer.text().match(/tt\d+/g)?.[0] ||
|
|
||||||
"";
|
|
||||||
// console.log(imdbId)
|
|
||||||
|
|
||||||
const type = heading?.next("p")?.text()?.includes("Series Name")
|
|
||||||
? "series"
|
|
||||||
: "movie";
|
|
||||||
// console.log(type);
|
|
||||||
// title
|
// title
|
||||||
const titleRegex = /Name: (.+)/;
|
let title = $("h1.post-title").text().trim();
|
||||||
const title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
|
if (!title) {
|
||||||
|
const heading = infoContainer?.find("h3");
|
||||||
|
const titleRegex = /Name: (.+)/;
|
||||||
|
title = heading?.next("p")?.text()?.match(titleRegex)?.[1] || "";
|
||||||
|
}
|
||||||
// console.log(title);
|
// console.log(title);
|
||||||
|
|
||||||
|
// imdbId
|
||||||
|
let imdbId =
|
||||||
|
$('a[href*="imdb.com"]').attr("href")?.match(/tt\d+/)?.[0] || "";
|
||||||
|
if (!imdbId) {
|
||||||
|
const heading = infoContainer?.find("h3");
|
||||||
|
imdbId =
|
||||||
|
//@ts-ignore
|
||||||
|
heading
|
||||||
|
?.next("p")
|
||||||
|
?.find("a")?.[0]
|
||||||
|
?.attribs?.href?.match(/tt\d+/g)?.[0] ||
|
||||||
|
infoContainer.text().match(/tt\d+/g)?.[0] ||
|
||||||
|
"";
|
||||||
|
}
|
||||||
|
// console.log(imdbId)
|
||||||
|
|
||||||
|
// type
|
||||||
|
let type = "movie";
|
||||||
|
|
||||||
|
const heading = infoContainer?.find("h3");
|
||||||
|
if (heading?.next("p")?.text()?.includes("Series Name")) {
|
||||||
|
type = "series";
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.log(type);
|
||||||
|
|
||||||
// synopsis
|
// synopsis
|
||||||
const synopsisNode = //@ts-ignore
|
let synopsis = "";
|
||||||
infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
|
const synopsisHeader = $("h3").filter(
|
||||||
const synopsis =
|
(i, el) =>
|
||||||
synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
|
$(el).text().includes("SYNOPSIS/PLOT") || $(el).text().includes("Plot"),
|
||||||
|
);
|
||||||
|
if (synopsisHeader.length > 0) {
|
||||||
|
synopsis = synopsisHeader.next("p").text().trim();
|
||||||
|
}
|
||||||
|
if (!synopsis) {
|
||||||
|
const synopsisNode = //@ts-ignore
|
||||||
|
infoContainer?.find("p")?.next("h3,h4")?.next("p")?.[0]?.children?.[0];
|
||||||
|
synopsis =
|
||||||
|
synopsisNode && "data" in synopsisNode ? synopsisNode.data : "";
|
||||||
|
}
|
||||||
// console.log(synopsis);
|
// console.log(synopsis);
|
||||||
|
|
||||||
// image
|
// image
|
||||||
let image =
|
let image =
|
||||||
infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") || "";
|
infoContainer?.find("img[data-lazy-src]")?.attr("data-lazy-src") ||
|
||||||
|
infoContainer
|
||||||
|
?.find("img")
|
||||||
|
?.filter((i, el) => {
|
||||||
|
const src = $(el).attr("src");
|
||||||
|
return (
|
||||||
|
!!src &&
|
||||||
|
!src.includes("logo") &&
|
||||||
|
!src.includes("svg") &&
|
||||||
|
!src.includes("placeholder") &&
|
||||||
|
!src.includes("icon")
|
||||||
|
);
|
||||||
|
})
|
||||||
|
?.first()
|
||||||
|
?.attr("src") ||
|
||||||
|
"";
|
||||||
|
|
||||||
if (image.startsWith("//")) {
|
if (image.startsWith("//")) {
|
||||||
image = "https:" + image;
|
image = "https:" + image;
|
||||||
}
|
}
|
||||||
@@ -75,7 +122,21 @@ export const getMeta = async ({
|
|||||||
|
|
||||||
console.log({ title, synopsis, image, imdbId, type });
|
console.log({ title, synopsis, image, imdbId, type });
|
||||||
/// Links
|
/// Links
|
||||||
const hr = infoContainer?.first()?.find("hr");
|
let hr = infoContainer?.first()?.find("hr");
|
||||||
|
|
||||||
|
// Try to find the HR before the download buttons if possible
|
||||||
|
const firstButton = $(".dwd-button").first();
|
||||||
|
if (firstButton.length > 0) {
|
||||||
|
const containerP = firstButton.closest("p");
|
||||||
|
let prev = containerP.prev();
|
||||||
|
while (prev.length && !prev.is("hr")) {
|
||||||
|
prev = prev.prev();
|
||||||
|
}
|
||||||
|
if (prev.is("hr")) {
|
||||||
|
hr = prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const list = hr?.nextUntil("hr");
|
const list = hr?.nextUntil("hr");
|
||||||
const links: Link[] = [];
|
const links: Link[] = [];
|
||||||
list.each((index, element: any) => {
|
list.each((index, element: any) => {
|
||||||
@@ -86,20 +147,23 @@ export const getMeta = async ({
|
|||||||
const quality = element?.text().match(/\d+p\b/)?.[0] || "";
|
const quality = element?.text().match(/\d+p\b/)?.[0] || "";
|
||||||
// console.log(title);
|
// console.log(title);
|
||||||
// movieLinks
|
// movieLinks
|
||||||
const movieLinks = element
|
const movieLinks =
|
||||||
?.next()
|
element
|
||||||
.find(".dwd-button")
|
?.next()
|
||||||
.text()
|
.find(".dwd-button")
|
||||||
.toLowerCase()
|
.text()
|
||||||
.includes("download")
|
.toLowerCase()
|
||||||
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
.includes("download") ||
|
||||||
: "";
|
element.next().find("a").text().toLowerCase().includes("download")
|
||||||
|
? element?.next().find(".dwd-button")?.parent()?.attr("href") ||
|
||||||
|
element?.next().find("a[href]")?.attr("href")
|
||||||
|
: "";
|
||||||
|
|
||||||
// episode links
|
// episode links
|
||||||
const vcloudLinks = element
|
const vcloudLinks = element
|
||||||
?.next()
|
?.next()
|
||||||
.find(
|
.find(
|
||||||
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152);color: white']"
|
".btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: white;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152); color: #fdf8f2;'],.btn-outline[style='background:linear-gradient(135deg,#ed0b0b,#f2d152);color: white']",
|
||||||
)
|
)
|
||||||
?.parent()
|
?.parent()
|
||||||
?.attr("href");
|
?.attr("href");
|
||||||
@@ -107,17 +171,17 @@ export const getMeta = async ({
|
|||||||
(vcloudLinks
|
(vcloudLinks
|
||||||
? vcloudLinks
|
? vcloudLinks
|
||||||
: element
|
: element
|
||||||
?.next()
|
?.next()
|
||||||
.find(".dwd-button")
|
.find(".dwd-button")
|
||||||
.text()
|
.text()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes("episode")
|
.includes("episode")
|
||||||
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
? element?.next().find(".dwd-button")?.parent()?.attr("href")
|
||||||
: "") ||
|
: "") ||
|
||||||
element
|
element
|
||||||
?.next()
|
?.next()
|
||||||
.find(
|
.find(
|
||||||
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']"
|
".btn-outline[style='background:linear-gradient(135deg,#0ebac3,#09d261); color: white;']",
|
||||||
)
|
)
|
||||||
?.parent()
|
?.parent()
|
||||||
?.attr("href");
|
?.attr("href");
|
||||||
|
|||||||
+49
-9
@@ -38,7 +38,9 @@ export const getPosts = async ({
|
|||||||
const baseUrl = await getBaseUrl("Vega");
|
const baseUrl = await getBaseUrl("Vega");
|
||||||
|
|
||||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||||
const url = `${baseUrl}/${filter}/page/${page}/`;
|
const url = filter
|
||||||
|
? `${baseUrl}/${filter}/page/${page}/`
|
||||||
|
: `${baseUrl}/page/${page}/`;
|
||||||
console.log("vegaGetPosts url:", url);
|
console.log("vegaGetPosts url:", url);
|
||||||
return posts(baseUrl, url, signal, headers, axios, cheerio);
|
return posts(baseUrl, url, signal, headers, axios, cheerio);
|
||||||
};
|
};
|
||||||
@@ -60,10 +62,39 @@ export const getSearchPosts = async ({
|
|||||||
const baseUrl = await getBaseUrl("Vega");
|
const baseUrl = await getBaseUrl("Vega");
|
||||||
|
|
||||||
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
console.log("vegaGetPosts baseUrl:", providerValue, baseUrl);
|
||||||
const url = `${baseUrl}/page/${page}/?s=${searchQuery}`;
|
const url = `${baseUrl}/search.php?q=${searchQuery}&page=${page}`;
|
||||||
console.log("vegaGetPosts url:", url);
|
console.log("vegaGetPosts url:", url);
|
||||||
|
|
||||||
return posts(baseUrl, url, signal, headers, axios, cheerio);
|
try {
|
||||||
|
const response = await axios.get(url, {
|
||||||
|
headers: {
|
||||||
|
...headers,
|
||||||
|
Referer: baseUrl,
|
||||||
|
},
|
||||||
|
signal,
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = response.data;
|
||||||
|
const posts: Post[] = [];
|
||||||
|
|
||||||
|
if (data?.hits) {
|
||||||
|
data.hits.forEach((hit: any) => {
|
||||||
|
const doc = hit.document;
|
||||||
|
const post = {
|
||||||
|
title: doc.post_title.replace("Download", "").trim(),
|
||||||
|
link: doc.permalink.startsWith("http")
|
||||||
|
? doc.permalink
|
||||||
|
: `${baseUrl}${doc.permalink}`,
|
||||||
|
image: doc.post_thumbnail,
|
||||||
|
};
|
||||||
|
posts.push(post);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return posts;
|
||||||
|
} catch (error) {
|
||||||
|
console.error("vegaGetSearchPosts error:", error);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function posts(
|
async function posts(
|
||||||
@@ -72,7 +103,7 @@ async function posts(
|
|||||||
signal: AbortSignal,
|
signal: AbortSignal,
|
||||||
headers: Record<string, string> = {},
|
headers: Record<string, string> = {},
|
||||||
axios: ProviderContext["axios"],
|
axios: ProviderContext["axios"],
|
||||||
cheerio: ProviderContext["cheerio"]
|
cheerio: ProviderContext["cheerio"],
|
||||||
): Promise<Post[]> {
|
): Promise<Post[]> {
|
||||||
try {
|
try {
|
||||||
const urlRes = await fetch(url, {
|
const urlRes = await fetch(url, {
|
||||||
@@ -84,31 +115,40 @@ async function posts(
|
|||||||
});
|
});
|
||||||
const $ = cheerio.load(await urlRes.text());
|
const $ = cheerio.load(await urlRes.text());
|
||||||
const posts: Post[] = [];
|
const posts: Post[] = [];
|
||||||
$(".blog-items,.post-list,#archive-container")
|
$(".blog-items,.post-list,#archive-container,.movies-grid")
|
||||||
?.children("article,.entry-list-item")
|
?.children("article,.entry-list-item,a")
|
||||||
?.each((index, element) => {
|
?.each((index, element) => {
|
||||||
const post = {
|
const post = {
|
||||||
title: (
|
title: (
|
||||||
$(element)
|
$(element)
|
||||||
?.find(".entry-title")
|
?.find(".entry-title,.poster-title")
|
||||||
?.text()
|
?.text()
|
||||||
?.replace("Download", "")
|
?.replace("Download", "")
|
||||||
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
|
?.match(/^(.*?)\s*\((\d{4})\)|^(.*?)\s*\((Season \d+)\)/)?.[0] ||
|
||||||
$(element)?.find("a")?.attr("title")?.replace("Download", "") ||
|
$(element)?.find("a")?.attr("title")?.replace("Download", "") ||
|
||||||
$(element)?.find(".post-title").text()?.replace("Download", "") ||
|
$(element)
|
||||||
|
?.find(".post-title,.poster-title")
|
||||||
|
.text()
|
||||||
|
?.replace("Download", "") ||
|
||||||
""
|
""
|
||||||
).trim(),
|
).trim(),
|
||||||
|
|
||||||
link: $(element)?.find("a")?.attr("href") || "",
|
link:
|
||||||
|
$(element)?.find("a")?.attr("href") ||
|
||||||
|
$(element)?.attr("href") ||
|
||||||
|
"",
|
||||||
image:
|
image:
|
||||||
$(element).find("a").find("img").attr("data-lazy-src") ||
|
$(element).find("a").find("img").attr("data-lazy-src") ||
|
||||||
$(element).find("a").find("img").attr("data-src") ||
|
$(element).find("a").find("img").attr("data-src") ||
|
||||||
$(element).find("a").find("img").attr("src") ||
|
$(element).find("a").find("img").attr("src") ||
|
||||||
|
$(element).find("img").attr("data-src") ||
|
||||||
|
$(element).find("img").attr("src") ||
|
||||||
"",
|
"",
|
||||||
};
|
};
|
||||||
if (post.image.startsWith("//")) {
|
if (post.image.startsWith("//")) {
|
||||||
post.image = "https:" + post.image;
|
post.image = "https:" + post.image;
|
||||||
}
|
}
|
||||||
|
console.log("vegaGetPosts post:", post);
|
||||||
posts.push(post);
|
posts.push(post);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -113,9 +113,9 @@ async function fetchPosts({
|
|||||||
|
|
||||||
// Image
|
// Image
|
||||||
let img =
|
let img =
|
||||||
|
card.find("img").attr("data-src") ||
|
||||||
card.find("img").attr("bv-data-src") ||
|
card.find("img").attr("bv-data-src") ||
|
||||||
card.find("img").attr("src") ||
|
card.find("img").attr("src") ||
|
||||||
card.find("img").attr("data-src") ||
|
|
||||||
card.find("img").attr("data-original") ||
|
card.find("img").attr("data-original") ||
|
||||||
"";
|
"";
|
||||||
const image = img ? resolveUrl(img) : "";
|
const image = img ? resolveUrl(img) : "";
|
||||||
@@ -128,7 +128,7 @@ async function fetchPosts({
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(
|
console.error(
|
||||||
"fetchPosts error:",
|
"fetchPosts error:",
|
||||||
err instanceof Error ? err.message : String(err)
|
err instanceof Error ? err.message : String(err),
|
||||||
);
|
);
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-22
@@ -3,10 +3,6 @@ const cheerio = require("cheerio");
|
|||||||
const axios = require("axios");
|
const axios = require("axios");
|
||||||
const { z } = require("zod");
|
const { z } = require("zod");
|
||||||
const { getBaseUrl } = require("./dist/getBaseUrl.js");
|
const { getBaseUrl } = require("./dist/getBaseUrl.js");
|
||||||
const { hubcloudExtracter } = require("./dist/hubcloudExtractor.js");
|
|
||||||
const { gofileExtracter } = require("./dist/gofileExtracter.js");
|
|
||||||
const { superVideoExtractor } = require("./dist/superVideoExtractor.js");
|
|
||||||
const { gdFlixExtracter } = require("./dist/gdFlixExtractor.js");
|
|
||||||
|
|
||||||
// Create readline interface
|
// Create readline interface
|
||||||
const rl = readline.createInterface({
|
const rl = readline.createInterface({
|
||||||
@@ -32,13 +28,7 @@ const providerContext = {
|
|||||||
"User-Agent":
|
"User-Agent":
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
|
||||||
},
|
},
|
||||||
extractors: {
|
Aes: {},
|
||||||
hubcloudExtracter: hubcloudExtracter,
|
|
||||||
gofileExtracter: gofileExtracter,
|
|
||||||
superVideoExtractor: superVideoExtractor,
|
|
||||||
gdFlixExtracter: gdFlixExtracter,
|
|
||||||
},
|
|
||||||
Crypto: {},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function parameter definitions based on README and types
|
// Function parameter definitions based on README and types
|
||||||
@@ -159,7 +149,7 @@ async function getParameters(functionName, providerName) {
|
|||||||
const sampleValue = sampleValues[functionName]?.[paramName] || "";
|
const sampleValue = sampleValues[functionName]?.[paramName] || "";
|
||||||
|
|
||||||
let value = await prompt(
|
let value = await prompt(
|
||||||
`${promptText}${sampleValue ? `[sample: ${sampleValue}] ` : ""}`
|
`${promptText}${sampleValue ? `[sample: ${sampleValue}] ` : ""}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!value && sampleValue) {
|
if (!value && sampleValue) {
|
||||||
@@ -207,7 +197,7 @@ async function testProvider(providerName, functionName) {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(
|
console.log(
|
||||||
`❌ Provider '${providerName}' not found or built. Make sure to run 'npm run build' first.`
|
`❌ Provider '${providerName}' not found or built. Make sure to run 'npm run build' first.`,
|
||||||
);
|
);
|
||||||
console.log(`Error: ${error.message}`);
|
console.log(`Error: ${error.message}`);
|
||||||
return;
|
return;
|
||||||
@@ -217,7 +207,7 @@ async function testProvider(providerName, functionName) {
|
|||||||
if (!module[functionName]) {
|
if (!module[functionName]) {
|
||||||
console.log(`❌ Function '${functionName}' not found in ${providerName}`);
|
console.log(`❌ Function '${functionName}' not found in ${providerName}`);
|
||||||
const availableFunctions = Object.keys(module).filter(
|
const availableFunctions = Object.keys(module).filter(
|
||||||
(key) => typeof module[key] === "function"
|
(key) => typeof module[key] === "function",
|
||||||
);
|
);
|
||||||
console.log(`Available functions: ${availableFunctions.join(", ")}`);
|
console.log(`Available functions: ${availableFunctions.join(", ")}`);
|
||||||
return;
|
return;
|
||||||
@@ -249,7 +239,7 @@ async function testProvider(providerName, functionName) {
|
|||||||
|
|
||||||
if (!validationResult.isValid) {
|
if (!validationResult.isValid) {
|
||||||
console.log(
|
console.log(
|
||||||
"\n💡 Tip: Check your provider implementation to ensure it returns the correct format."
|
"\n💡 Tip: Check your provider implementation to ensure it returns the correct format.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -281,7 +271,7 @@ const StreamSchema = z.object({
|
|||||||
language: z.string(),
|
language: z.string(),
|
||||||
type: z.string(),
|
type: z.string(),
|
||||||
uri: z.string().url(),
|
uri: z.string().url(),
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
headers: z.any().optional(),
|
headers: z.any().optional(),
|
||||||
@@ -297,7 +287,7 @@ const LinkSchema = z.object({
|
|||||||
title: z.string().min(1, "Direct link title cannot be empty"),
|
title: z.string().min(1, "Direct link title cannot be empty"),
|
||||||
link: z.string().url("Direct link must be a valid URL"),
|
link: z.string().url("Direct link must be a valid URL"),
|
||||||
type: z.enum(["movie", "series"]).optional(),
|
type: z.enum(["movie", "series"]).optional(),
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
});
|
});
|
||||||
@@ -421,7 +411,7 @@ async function main() {
|
|||||||
console.log("\nFlags:");
|
console.log("\nFlags:");
|
||||||
console.log(" --rebuild Rebuild TypeScript files before testing");
|
console.log(" --rebuild Rebuild TypeScript files before testing");
|
||||||
console.log(
|
console.log(
|
||||||
"\nNote: Run with --rebuild flag if you've made changes to TypeScript files!"
|
"\nNote: Run with --rebuild flag if you've made changes to TypeScript files!",
|
||||||
);
|
);
|
||||||
rl.close();
|
rl.close();
|
||||||
return;
|
return;
|
||||||
@@ -430,16 +420,15 @@ async function main() {
|
|||||||
if (args.length < 2) {
|
if (args.length < 2) {
|
||||||
console.log("❌ Please provide both provider name and function name");
|
console.log("❌ Please provide both provider name and function name");
|
||||||
console.log(
|
console.log(
|
||||||
"Usage: node test-provider.js <provider> <function> [--rebuild]"
|
"Usage: node test-provider.js <provider> <function> [--rebuild]",
|
||||||
);
|
);
|
||||||
rl.close();
|
rl.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const providerName = args[0];
|
const providerName = args[0];
|
||||||
const functionName = args[1];
|
|
||||||
|
|
||||||
// Validate function name
|
// Validate function name (case-insensitive)
|
||||||
const validFunctions = [
|
const validFunctions = [
|
||||||
"getPosts",
|
"getPosts",
|
||||||
"getSearchPosts",
|
"getSearchPosts",
|
||||||
@@ -447,8 +436,11 @@ async function main() {
|
|||||||
"getEpisodes",
|
"getEpisodes",
|
||||||
"getStream",
|
"getStream",
|
||||||
];
|
];
|
||||||
|
const functionName =
|
||||||
|
validFunctions.find((f) => f.toLowerCase() === args[1].toLowerCase()) ??
|
||||||
|
args[1];
|
||||||
if (!validFunctions.includes(functionName)) {
|
if (!validFunctions.includes(functionName)) {
|
||||||
console.log(`❌ Invalid function name: ${functionName}`);
|
console.log(`❌ Invalid function name: ${args[1]}`);
|
||||||
console.log(`Valid functions: ${validFunctions.join(", ")}`);
|
console.log(`Valid functions: ${validFunctions.join(", ")}`);
|
||||||
rl.close();
|
rl.close();
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user