Skip to content

Instantly share code, notes, and snippets.

@manzxy
Created December 27, 2025 13:37
Show Gist options
  • Select an option

  • Save manzxy/4582332c16e30719abd319725b11e062 to your computer and use it in GitHub Desktop.

Select an option

Save manzxy/4582332c16e30719abd319725b11e062 to your computer and use it in GitHub Desktop.
Uploaded via YogiriMD
/**
β€’ Fitur: Komikindo Search & Detail
β€’ Sumber:https://whatsapp.com/channel/0029VbBS8ys0G0XnmJFRiV2v
β€’ Sumber Scrape: https://whatsapp.com/channel/0029VaxtSLDGZNCjvEXsw93f/251
**/
import axios from "axios"
import * as cheerio from "cheerio"
/* =========================
SCRAPER (ASLI, DISATUKAN)
========================= */
async function searchKomik(query) {
const { data: html } = await axios.get("https://komikindo.ch", {
params: { s: query }
})
const $ = cheerio.load(html)
let result = []
$(".animposx").each((_, el) => {
const title = $(el).find("h3").text().trim()
const imageUrl = $(el).find("img").attr("src")
const rating = $(el).find(".rating").text().trim()
const linkKomik = $(el).find(".tt > h3 > a").attr("href")
if (title && linkKomik) {
result.push({
title,
imageUrl,
rating,
linkKomik
})
}
})
return result
}
async function getDetail(url) {
const { data: html } = await axios.get(url)
const $ = cheerio.load(html)
const title =
$('meta[property="og:title"]').attr("content") ||
$("title").text().trim()
const imageUrl = $(".thumb img").attr("src")
const rating = $(".rating").text().trim().match(/\d+/)?.[0] || "N/A"
let detail = []
$(".spe span").each((_, el) => {
const text = $(el).text().replace(/\s+/g, " ").trim()
const parts = text.split(":")
if (parts.length >= 2) {
detail.push(parts.slice(1).join(":").trim())
}
})
return {
title,
imageUrl,
rating,
link: url,
judulAlternatif: detail[0] || "-",
status: detail[1] || "-",
pengarang: detail[2] || "-",
ilustrator: detail[3] || "-",
grafis: detail[4] || "-",
tema: detail[5] || "-",
jenisKomik: detail[6] || "-",
official: detail[7] || "-",
informasi: detail[8] || "-"
}
}
/* =========================
HANDLER
========================= */
let handler = async (m, { text, usedPrefix, command, conn }) => {
if (!text) {
return m.reply(
`πŸ“š *KomikIndo*
Gunakan:
${usedPrefix + command} <judul>
${usedPrefix + command} detail <link>
Contoh:
${usedPrefix + command} return of top class master`
)
}
if (text.startsWith("detail ")) {
const url = text.replace("detail ", "").trim()
if (!url.startsWith("http"))
return m.reply("❌ Link tidak valid")
await m.reply("πŸ” Mengambil detail komik...")
try {
const d = await getDetail(url)
return conn.sendMessage(
m.chat,
{
image: { url: d.imageUrl },
caption:
`πŸ“– *${d.title}*
⭐ Rating: ${d.rating}
β€’ Judul Alt : ${d.judulAlternatif}
β€’ Status : ${d.status}
β€’ Pengarang : ${d.pengarang}
β€’ Ilustrator: ${d.ilustrator}
β€’ Grafis : ${d.grafis}
β€’ Tema : ${d.tema}
β€’ Jenis : ${d.jenisKomik}
β€’ Official : ${d.official}
πŸ”— ${d.link}`
},
{ quoted: m }
)
} catch (e) {
console.error(e)
return m.reply("❌ Gagal mengambil detail komik")
}
}
await m.reply("πŸ”Ž Mencari komik...")
try {
const res = await searchKomik(text)
if (!res.length) return m.reply("❌ Komik tidak ditemukan")
let list = `πŸ“š *Hasil Pencarian KomikIndo*\n\n`
res.slice(0, 10).forEach((v, i) => {
list +=
`${i + 1}. *${v.title}*
⭐ ${v.rating || "-"}
πŸ”— ${v.linkKomik}\n\n`
})
list += `Ketik:\n${usedPrefix + command} detail <link>`
return m.reply(list)
} catch (e) {
console.error(e)
m.reply("❌ Error saat mencari komik")
}
}
handler.help = ["komikindo <judul>", "komikindo detail <link>"]
handler.tags = ["anime"]
handler.command = /^komikindo$/i
export default handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment