Created
July 3, 2025 14:58
-
-
Save ZTRdiamond/c6b5c89e406da15d47ec0c9c18b802e6 to your computer and use it in GitHub Desktop.
Smart anime finding from image, screenshot, low quality image, etc
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
| import axios from "axios"; | |
| import FormData from "form-data"; | |
| export default async function animefinder(image) { | |
| try { | |
| return new Promise(async(resolve, reject) => { | |
| if(!Buffer.isBuffer(image)) return reject("missing input or invalid buffer!"); | |
| const form = new FormData(); | |
| form.append("image", image, { | |
| 'filename': Date.now() + '.png', | |
| 'content-type': 'image/png' | |
| }); | |
| axios.post('https://www.animefinder.xyz/api/identify', form, { | |
| headers: { | |
| ...form.getHeaders(), | |
| 'Accept': '*/*', | |
| 'Origin': 'https://www.animefinder.xyz', | |
| 'Referer': 'https://www.animefinder.xyz/', | |
| 'User-Agent': 'Zanixon/1.0.0' | |
| } | |
| }).then(raw => { | |
| const data = raw.data; | |
| if(!data?.references) return reject(data.description || "failed identifying anime"); | |
| return resolve({ | |
| success: true, | |
| result: data | |
| }) | |
| }).catch(reject) | |
| }) | |
| } catch (e) { | |
| return { | |
| success: false, | |
| errors: e | |
| } | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Anime Finder API
π Deskripsi
Fungsi ini digunakan untuk mengenali cuplikan anime dari sebuah gambar menggunakan layanan API animefinder.xyz. Gambar dikirim sebagai buffer dan dikembalikan informasi lengkap anime jika cocok ditemukan.
π₯ Parameter
image(Buffer): Gambar dalam formatBuffer, wajib bertipe PNG.π€ Return
Promise<Object>{ "success": true, "result": { "animeTitle": "The Quintessential Quintuplets", "character": "Miku Nakano", "description": "Penjelasan tentang karakter dalam gambar.", "genres": "Harem, Romantic Comedy, School", "synopsis": "Ringkasan cerita anime.", "productionHouse": "Tezuka Productions", "premiereDate": "January 10, 2019", "references": [ { "site": "MyAnimeList", "url": "https://myanimelist.net/anime/38101/Go-toubun_no_Hanayome" }, { "site": "Crunchyroll", "url": "https://www.crunchyroll.com/the-quintessential-quintuplets" }, { "site": "Anime-Planet", "url": "https://www.anime-planet.com/anime/the-quintessential-quintuplets" } ] } }{ "success": false, "errors": "missing input or invalid buffer!" }π Struktur Data Hasil
animeTitle: Judul animecharacter: Nama karakter utamadescription: Deskripsi visual karakter dan scenegenres: Genre anime (dipisahkan koma)synopsis: Ringkasan ceritaproductionHouse: Studio produksipremiereDate: Tanggal tayang pertamareferences[]: Daftar referensi:site: Nama situsurl: Link ke halaman animeπ Contoh Penggunaan
π Catatan
Buffer, disarankan PNG.