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) {
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 {
const response = await fetchv2("https://www.1tamilcrow.net/?s=" + keyword);
const html = await response.text();
let match;
while ((match = regex.exec(html)) !== null) {
results.push({
href: match[2].trim(),
title: decodeHtml(match[3].trim()),
image: match[1] ? match[1].trim() : "No Image"
});
}
while ((match = articleRegex.exec(html)) !== null) {
const articleContent = match[1];
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);
} catch (err) {
return JSON.stringify([{
title: "Error",
image: "Error",
href: "Error"
}]);
return JSON.stringify([{ title: "Error", image: "Error", href: "Error" }]);
}
}
@ -51,19 +60,27 @@ async function extractDetails(url) {
}]);
}
}
async function extractEpisodes(url) {
const results = [];
try {
const response = await fetchv2(url);
const html = await response.text();
console.log(html);
const regex = /<IFRAME[^>]*SRC="(https:\/\/(?:videospk|vidhidevip)[^"]+)"[^>]*>/;
const match = html.match(regex);
const regex = /<iframe[^>]*src=["']([^"']+)["'][^>]*>/gi;
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({
href: match[1].trim(),
href: foundUrl,
number: 1
});
} else {
@ -86,18 +103,24 @@ async function extractStreamUrl(url) {
try {
const response = await fetchv2(url);
const html = await response.text();
const obfuscatedScript = html.match(/<script[^>]*>\s*(eval\(function\(p,a,c,k,e,d.*?\)[\s\S]*?)<\/script>/);
const unpackedScript = unpack(obfuscatedScript[1]);
const streamMatch = unpackedScript.match(/["'](\/stream\/[^"']+)["']/);
const hlsLink = streamMatch ? streamMatch[1] : null;
const baseUrl = url.match(/^(https?:\/\/[^/]+)/)[1];
console.log("HLS Link:" + hlsLink);
return baseUrl + hlsLink;
const hls2Match = unpackedScript.match(/["']hls2["']\s*:\s*["']([^"']+)["']/);
if (hls2Match && hls2Match[1]) {
const hlsUrl = hls2Match[1];
console.log("HLS2 Link:", hlsUrl);
return hlsUrl;
}
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) {
console.log(err);
return "https://files.catbox.moe/avolvc.mp4";