Created
December 27, 2025 13:37
-
-
Save manzxy/4582332c16e30719abd319725b11e062 to your computer and use it in GitHub Desktop.
Uploaded via YogiriMD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| β’ 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