This commit is contained in:
himanshu8443
2025-06-16 22:35:39 +05:30
parent 4c95efcb5b
commit a21dad9698
123 changed files with 8099 additions and 159 deletions

66
dist/ridoMovies/posts.js vendored Normal file
View File

@@ -0,0 +1,66 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getSearchPosts = exports.getPosts = void 0;
const getPosts = async function ({ filter, signal, providerContext, }) {
try {
const catalog = [];
const url = "https://cinemeta-catalogs.strem.io" + filter;
console.log("allGetPostUrl", url);
const res = await providerContext.axios.get(url, {
headers: providerContext.commonHeaders,
signal,
});
const data = res.data;
data?.metas.map((result) => {
const title = result?.name;
const id = result?.imdb_id || result?.id;
const type = result?.type;
const image = result?.poster;
if (id) {
catalog.push({
title: title,
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
image: image,
});
}
});
console.log("catalog", catalog.length);
return catalog;
}
catch (err) {
console.error("AutoEmbed error ", err);
return [];
}
};
exports.getPosts = getPosts;
const getSearchPosts = async function ({ searchQuery, page, signal, providerContext, }) {
try {
const { axios, commonHeaders: headers } = providerContext;
if (page > 1) {
return [];
}
const catalog = [];
const url2 = `https://v3-cinemeta.strem.io/catalog/movie/top/search=${encodeURI(searchQuery)}.json`;
const res2 = await axios.get(url2, { headers, signal });
const data2 = res2.data;
data2?.metas.map((result) => {
const title = result?.name || "";
const id = result?.imdb_id || result?.id;
const image = result?.poster;
const type = result?.type;
if (id) {
catalog.push({
title: title,
link: `https://v3-cinemeta.strem.io/meta/${type}/${id}.json`,
image: image,
});
}
});
return catalog;
}
catch (err) {
console.error("AutoEmbed error ", err);
return [];
}
};
exports.getSearchPosts = getSearchPosts;