Package Exports
- zencf
- zencf/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zencf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
🚀 zencf - CF Clearance Scraper Module
Klien API untuk Cloudflare Bypass
Bypass Cloudflare WAF & Turnstile tanpa browser headless.
zencf adalah klien ringan untuk mengatasi tantangan Cloudflare seperti WAF dan Turnstile tanpa perlu menjalankan browser headless.
💾 Instalasi
Menggunakan npm
npm install zencf
Menggunakan yarn
yarn add zencf📋 Penggunaan
Modul ini mendukung CommonJS (require) dan ES Modules (import).
🧱 Contoh Penggunaan — CommonJS
• WAF Session
const { zencf } = require('zencf')
async function main() {
const session = await zencf.wafSession('httos://example.com/')
console.log('Cookies:', session.cookies)
console.log('User-Agent:', session.headers['User-Agent'])
}
main().catch(console.error)• Turnstile Min
const { zencf } = require('zencf')
async function solve() {
const { token } = await zencf.turnstileMin(
'https://spotimate.io',
'0x4AAAAAAA_b5m4iQN755mZw'
)
console.log('Turnstile Token:', token)
}
solve().catch(console.error)• Turnstile Max
const { zencf } = require('zencf')
async function solve() {
const { token } = await zencf.turnstileMax(
'https://spotimate.io'
)
console.log('Turnstile Token (Max):', token)
}
solve().catch(console.error)• Ambil HTML Source
const { zencf } = require('zencf')
async function getSource() {
const res = await zencf.source('httos://example.com/')
console.log(res.source.slice(0, 300))
}
getSource().catch(console.error)📦 Contoh Penggunaan — ES Modules (Static Import)
• Turnstile Min
import { zencf } from 'zencf'
const { token } = await zencf.turnstileMin(
'https://spotimate.io',
'0x4AAAAAAA_b5m4iQN755mZw'
)
console.log('Token Turnstile:', token)• WAF Session
import { zencf } from 'zencf'
const session = await zencf.wafSession('httos://example.com/')
console.log(session.cookies)
console.log(session.headers['User-Agent'])• Ambil Source (ESM)
import { zencf } from 'zencf'
const page = await zencf.source('https://spa-website.com/')
console.log(page.source.substring(0, 200) + '...')⚙️ ES Modules — Dynamic Import
async function run() {
const { zencf } = await import('zencf')
const { token } = await zencf.turnstileMin(
'https://spotimate.io',
'0x4AAAAAAA_b5m4iQN755mZw'
)
console.log(token)
}
run().catch(console.error)🧭 API Reference
Semua fungsi bersifat async dan akan melempar Error jika gagal.
1️⃣ zencf.wafSession(url, proxy?)
Mengambil cookies dan headers untuk melewati Cloudflare WAF.
Parameter:
url (string, wajib) — URL target
proxy (string, opsional) — host:port atau user:pass@host:port
const session = await zencf.wafSession('https://example.com')2️⃣ zencf.turnstileMin(url, siteKey, proxy?)
Menyelesaikan Cloudflare Turnstile dengan mode cepat.
const { token } = await zencf.turnstileMin(
'https://example.com/login',
'SITE_KEY'
)3️⃣ zencf.turnstileMax(url, proxy?)
Mode maksimum dengan simulasi interaksi pengguna.
const { token } = await zencf.turnstileMax('https://example.com')4️⃣ zencf.source(url, proxy?)
Mengambil HTML halaman setelah melewati Cloudflare.
const res = await zencf.source('https://spa-website.com')
console.log(res.source)⚠️ Penanganan Error
try {
const { token } = await zencf.turnstileMin(url, siteKey)
console.log(token)
} catch (err) {
console.error('zencf error:', err.message)
}🔒 Catatan Keamanan
Token Turnstile harus diverifikasi di server-side
Hindari logging token sensitif di produksi
Gunakan proxy dari sumber tepercaya
🧠 Tips Penggunaan
turnstileMin → cepat & ringan
turnstileMax → proteksi ketat
wafSession → tahap awal scraping
source → situs SPA / HTML awal