This commit is contained in:
50/50 2025-12-17 22:22:22 +01:00
commit 9d1202704d
3 changed files with 52 additions and 15 deletions

View file

@ -1,21 +1,57 @@
async function searchResults(keyword) {
const results = [];
const headers = {
"Content-Type": "multipart/form-data; boundary=----geckoformboundary38c356867533a17de80e8c65d9125df5"
};
const postData = `------geckoformboundary38c356867533a17de80e8c65d9125df5
Content-Disposition: form-data; name="s_keyword"
${keyword}
------geckoformboundary38c356867533a17de80e8c65d9125df5
Content-Disposition: form-data; name="orderby"
popular
------geckoformboundary38c356867533a17de80e8c65d9125df5
Content-Disposition: form-data; name="order"
DESC
------geckoformboundary38c356867533a17de80e8c65d9125df5
Content-Disposition: form-data; name="action"
advanced_search
------geckoformboundary38c356867533a17de80e8c65d9125df5
Content-Disposition: form-data; name="page"
1
------geckoformboundary38c356867533a17de80e8c65d9125df5--`;
try {
const response = await fetchv2("https://anihq.to/search/?s_keyword=" + encodeURIComponent(keyword));
const html = await response.text();
const response = await fetchv2("https://anihq.org/wp-admin/admin-ajax.php", headers, "POST", postData);
const data = await response.json();
const html = data.data.html;
const articlePattern = /<article[^>]*class="anime-card[^"]*"[^>]*>([\s\S]*?)<\/article>/g;
let articleMatch;
const regex = /<div class="w-full bg-gradient-to-t from-primary to-transparent[^"]*"[\s\S]*?<img src=['"]([^'"]+)['"][^>]*alt=['"]([^'"]+)['"][\s\S]*?<a[^>]+href=['"]([^'"]+)['"][\s\S]*?<\/div>\s*<\/div>/g;
let match;
while ((match = regex.exec(html)) !== null) {
results.push({
title: match[2].trim(),
image: match[1].trim(),
href: match[3].trim()
});
while ((articleMatch = articlePattern.exec(html)) !== null) {
const articleHtml = articleMatch[1];
const imgMatch = articleHtml.match(/<img[^>]+src=['"]([^'"]+)['"][^>]+alt=['"]([^'"]+)['"]/);
const linkMatch = articleHtml.match(/<h3[^>]*>[\s\S]*?<a[^>]+href=['"]([^'"]+)['"][^>]*title=['"]([^'"]+)['"]/);
if (imgMatch && linkMatch) {
results.push({
title: linkMatch[2].trim(),
image: imgMatch[1].trim(),
href: linkMatch[1].trim()
});
}
}
return JSON.stringify(results);
} catch (err) {
console.log(err);
return JSON.stringify([{
title: "Error",
image: "Error",
@ -24,6 +60,7 @@ async function searchResults(keyword) {
}
}
async function extractDetails(url) {
try {
const response = await fetchv2(url);
@ -105,7 +142,7 @@ async function extractStreamUrl(url) {
const response = await fetchv2(url);
const html = await response.text();
const iframeMatch = html.match(/(?:data-lazy-src|src)=["']https:\/\/(anihqq?\.strp2p\.com)\/#([^"']+)["']/);
const iframeMatch = html.match(/<iframe[^>]+src=['"]https:\/\/([^'"]+\.playerp2p\.com)\/#([^'"]+)['"]/);
if (!iframeMatch) {
console.log("No iframe ID found");

View file

@ -5,7 +5,7 @@
"name": "50/50",
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
},
"version": "1.0.0",
"version": "1.0.1",
"language": "English",
"streamType": "HLS",
"quality": "1080p",

View file

@ -194,7 +194,7 @@ async function extractStreamUrl(ID) {
const imdbId = cinebyData.external_ids?.imdb_id || '';
const tmdbId = cinebyData.id;
const fullUrl = `https://api.videasy.net/cdn/sources-with-title?title=${title}&mediaType=movie&year=${year}&episodeId=1&seasonId=1&tmdbId=${tmdbId}&imdbId=${imdbId}`;
const fullUrl = `https://api.videasy.net/myflixerzupcloud/sources-with-title?title=${title}&mediaType=movie&year=${year}&episodeId=1&seasonId=1&tmdbId=${tmdbId}&imdbId=${imdbId}`;
console.log('Full URL:' + fullUrl);
@ -253,7 +253,7 @@ async function extractStreamUrl(ID) {
const imdbId = cinebyData.external_ids?.imdb_id || '';
const tmdbId = cinebyData.id;
const fullUrl = `https://api.videasy.net/cdn/sources-with-title?title=${title}&mediaType=tv&year=${year}&episodeId=${episodeNumber}&seasonId=${seasonNumber}&tmdbId=${tmdbId}&imdbId=${imdbId}`;
const fullUrl = `https://api.videasy.net/myflixerzupcloud/sources-with-title?title=${title}&mediaType=tv&year=${year}&episodeId=${episodeNumber}&seasonId=${seasonNumber}&tmdbId=${tmdbId}&imdbId=${imdbId}`;
console.log('Full URL:' + fullUrl);