Update 1tamilcrow/1tamilcrow.js

This commit is contained in:
aka paul 2025-12-17 20:26:11 +00:00
parent d848bebbcd
commit ed08072dcb

View file

@ -1,27 +1,36 @@
async function searchResults(keyword) { async function searchResults(keyword) {
const results = []; const results = [];
const regex = /<div class="vw-post-box vw-post-box--block-a[\s\S]*?(?:<img[^>]*src="([^"]+)"[\s\S]*?)?<a href="([^"]+)" class="vw-post-box__overlay[\s\S]*?<h3 class="vw-post-box__title"[\s\S]*?<a class="vw-post-box__link"[^>]*>\s*([^<]+)\s*<\/a>/g;
const articleRegex = /<article[^>]*class="post-item[^"]*"[^>]*>([\s\S]*?)<\/article>/g;
const imageRegex = /<img[^>]*src="([^"]+)"[^>]*alt="([^"]*)"[^>]*>/;
const linkRegex = /<a[^>]*class="post-listing-title"[^>]*href="([^"]+)"[^>]*title="[^"]*">([^<]+)<\/a>/;
try { try {
const response = await fetchv2("https://www.1tamilcrow.net/?s=" + keyword); const response = await fetchv2("https://www.1tamilcrow.net/?s=" + keyword);
const html = await response.text(); const html = await response.text();
let match; let match;
while ((match = regex.exec(html)) !== null) { while ((match = articleRegex.exec(html)) !== null) {
results.push({ const articleContent = match[1];
href: match[2].trim(),
title: decodeHtml(match[3].trim()),
image: match[1] ? match[1].trim() : "No Image"
});
}
const imageMatch = imageRegex.exec(articleContent);
const image = imageMatch ? imageMatch[1].trim() : "No Image";
const linkMatch = linkRegex.exec(articleContent);
if (linkMatch) {
results.push({
href: linkMatch[1].trim(),
title: decodeHtml(linkMatch[2].trim()),
image: image
});
}
}
return JSON.stringify(results); return JSON.stringify(results);
} catch (err) { } catch (err) {
return JSON.stringify([{ return JSON.stringify([{ title: "Error", image: "Error", href: "Error" }]);
title: "Error",
image: "Error",
href: "Error"
}]);
} }
} }
@ -51,19 +60,27 @@ async function extractDetails(url) {
}]); }]);
} }
} }
async function extractEpisodes(url) { async function extractEpisodes(url) {
const results = []; const results = [];
try { try {
const response = await fetchv2(url); const response = await fetchv2(url);
const html = await response.text(); const html = await response.text();
console.log(html);
const regex = /<IFRAME[^>]*SRC="(https:\/\/(?:videospk|vidhidevip)[^"]+)"[^>]*>/; const regex = /<iframe[^>]*src=["']([^"']+)["'][^>]*>/gi;
const match = html.match(regex); let match;
let foundUrl = null;
if (match) { while ((match = regex.exec(html)) !== null) {
const iframeUrl = match[1].trim();
if (!iframeUrl.includes('voe.sx')) {
foundUrl = iframeUrl;
break;
}
}
if (foundUrl) {
results.push({ results.push({
href: match[1].trim(), href: foundUrl,
number: 1 number: 1
}); });
} else { } else {
@ -86,18 +103,24 @@ async function extractStreamUrl(url) {
try { try {
const response = await fetchv2(url); const response = await fetchv2(url);
const html = await response.text(); const html = await response.text();
const obfuscatedScript = html.match(/<script[^>]*>\s*(eval\(function\(p,a,c,k,e,d.*?\)[\s\S]*?)<\/script>/); const obfuscatedScript = html.match(/<script[^>]*>\s*(eval\(function\(p,a,c,k,e,d.*?\)[\s\S]*?)<\/script>/);
const unpackedScript = unpack(obfuscatedScript[1]); const unpackedScript = unpack(obfuscatedScript[1]);
const streamMatch = unpackedScript.match(/["'](\/stream\/[^"']+)["']/); const hls2Match = unpackedScript.match(/["']hls2["']\s*:\s*["']([^"']+)["']/);
const hlsLink = streamMatch ? streamMatch[1] : null;
if (hls2Match && hls2Match[1]) {
const baseUrl = url.match(/^(https?:\/\/[^/]+)/)[1]; const hlsUrl = hls2Match[1];
console.log("HLS2 Link:", hlsUrl);
console.log("HLS Link:" + hlsLink); return hlsUrl;
}
return baseUrl + hlsLink;
const m3u8Match = unpackedScript.match(/(https?:\/\/[^"'\s]+\.m3u8[^"'\s]*)/);
if (m3u8Match && m3u8Match[1]) {
console.log("Fallback M3U8 Link:", m3u8Match[1]);
return m3u8Match[1];
}
return "https://files.catbox.moe/avolvc.mp4";
} catch (err) { } catch (err) {
console.log(err); console.log(err);
return "https://files.catbox.moe/avolvc.mp4"; return "https://files.catbox.moe/avolvc.mp4";