generaljavascript152
SinhalaCHR Workers - Direct Video Stream & Media Downloader
High-speed media and stream extractor for Cloudflare Workers (sinhalachr.workers.dev). Extracts video metadata, resolution, direct Playbook CDN streaming URL, and fast direct download URL with zero Cloudflare captcha blocking.
Vamz Spectre13 Okt 2026117 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/sinhalachr-worker-scraper" -o sinhalachr-worker-scraper.js
# 2. Jalankan script
node sinhalachr-worker-scraper.js
sinhalachr-worker-scraper.js(117 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/**
* ========================================================
* Name: SinhalaCHR Workers Direct Stream & Media Downloader
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/sinhalachr-worker-scraper" -o sinhalachr-worker-scraper.js
*
* Cara Eksekusi:
* node sinhalachr-worker-scraper.js "https://iws.sinhalachr.workers.dev/?id=HdaKhupc8mNuambr8F1UUvdQ&assetToken=V8iqjRWAxddTFaQD2DZ6qdZM"
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
const DEFAULT_HEADERS = {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.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",
};
/**
* Extractor Utama SinhalaCHR Cloudflare Worker
* Mengurai judul, ukuran file, resolusi, direct Playbook CDN stream, dan direct download link.
*/
async function extractSinhalaCHR(targetUrl) {
const cleanUrl = (targetUrl || "").trim();
if (!cleanUrl) {
throw new Error("URL SinhalaCHR Worker wajib disertakan!");
}
const res = await fetch(cleanUrl, {
headers: DEFAULT_HEADERS,
});
if (!res.ok) {
throw new Error(`Gagal mengakses SinhalaCHR Worker: HTTP ${res.status}`);
}
const html = await res.text();
// Ekstrak Metadata Video
const titleMatch = html.match(/<strong>Title:<\/strong>\s*([^<]+)<\/p>/i);
const sizeMatch = html.match(/<strong>Size:<\/strong>\s*([^<]+)<\/p>/i);
const resMatch = html.match(/<strong>Resolution:<\/strong>\s*([^<]+)<\/p>/i);
const videoSourceMatch = html.match(/<source\s+src=["']([^"']+)["']/i);
const telegramMatch = html.match(/<a\s+href=["'](https:\/\/t\.me\/[^"']+)["']/i);
// Buat Direct Download URL
let downloadUrl = null;
try {
const parsed = new URL(cleanUrl);
const id = parsed.searchParams.get("id");
const assetToken = parsed.searchParams.get("assetToken");
if (id && assetToken) {
downloadUrl = `${parsed.origin}/?id=${encodeURIComponent(id)}&assetToken=${encodeURIComponent(assetToken)}&download=true`;
}
} catch {}
const streamUrl = videoSourceMatch ? videoSourceMatch[1] : null;
return {
status: true,
platform: "SinhalaCHR Workers",
type: "direct_video_stream",
title: titleMatch ? titleMatch[1].trim() : "SinhalaCHR Video",
size: sizeMatch ? sizeMatch[1].trim() : null,
resolution: resMatch ? resMatch[1].trim() : null,
direct_stream_url: streamUrl,
direct_download_url: downloadUrl,
telegram_channel: telegramMatch ? telegramMatch[1] : "https://t.me/sinhalaaaa",
source_url: cleanUrl,
};
}
// Safe Export
if (typeof module !== "undefined" && module.exports) {
module.exports = {
extractSinhalaCHR,
default: extractSinhalaCHR,
};
}
// CLI Runner
const cliArgs = process.argv.slice(2);
const targetInput = cliArgs[0] ? cliArgs[0].trim() : null;
async function runCli() {
if (!targetInput) {
console.log(
JSON.stringify(
{
status: false,
message: "Parameter URL SinhalaCHR Worker belum disertakan.",
usage: 'node sinhalachr-worker-scraper.js "<url_sinhalachr>"',
example:
'node sinhalachr-worker-scraper.js "https://iws.sinhalachr.workers.dev/?id=HdaKhupc8mNuambr8F1UUvdQ&assetToken=V8iqjRWAxddTFaQD2DZ6qdZM"',
},
null,
2
)
);
process.exit(1);
}
const result = await extractSinhalaCHR(targetInput);
console.log(JSON.stringify(result, null, 2));
}
if (process.argv[1]) {
runCli().catch((err) => {
console.error(JSON.stringify({ status: false, error: err.message || String(err) }, null, 2));
process.exit(1);
});
}