Created
December 27, 2025 14:17
-
-
Save manzxy/6de93f30925d5802f27e2e2c9ed5f935 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: Txt2img & Txt2vid | |
| • Sumber: https://whatsapp.com/channel/0029VbBS8ys0G0XnmJFRiV2v | |
| • Sumber Scrape: https://whatsapp.com/channel/0029VbBuiBx3wtbBplt2tl3c/129 | |
| **/ | |
| import axios from 'axios' | |
| import FormData from 'form-data' | |
| const AgungDevX = { | |
| config: { | |
| base: 'https://text2video.aritek.app', | |
| cipher: 'hbMcgZLlzvghRlLbPcTbCpfcQKM0PcU0zhPcTlOFMxBZ1oLmruzlVp9remPgi0QWP0QW', | |
| shift: 3, | |
| ua: 'AgungDevX Coder/1.0.0' | |
| }, | |
| _decryptToken() { | |
| const { cipher, shift } = this.config | |
| return [...cipher].map(c => | |
| /[a-z]/.test(c) | |
| ? String.fromCharCode((c.charCodeAt(0) - 97 - shift + 26) % 26 + 97) | |
| : /[A-Z]/.test(c) | |
| ? String.fromCharCode((c.charCodeAt(0) - 65 - shift + 26) % 26 + 65) | |
| : c | |
| ).join('') | |
| }, | |
| async text2img(prompt) { | |
| if (!prompt) throw 'Prompt kosong' | |
| const token = this._decryptToken() | |
| const form = new FormData() | |
| form.append('prompt', prompt) | |
| form.append('token', token) | |
| const { data } = await axios.post( | |
| `${this.config.base}/text2img`, | |
| form, | |
| { | |
| headers: { | |
| 'user-agent': this.config.ua, | |
| authorization: token, | |
| ...form.getHeaders() | |
| } | |
| } | |
| ) | |
| if (data.code !== 0 || !data.url) throw 'Gagal generate gambar' | |
| return data.url.trim() | |
| }, | |
| async text2video(prompt) { | |
| if (!prompt) throw 'Prompt kosong' | |
| const token = this._decryptToken() | |
| const payload = { | |
| deviceID: Math.random().toString(16).slice(2) + Math.random().toString(16).slice(2), | |
| isPremium: 1, | |
| prompt, | |
| used: [], | |
| versionCode: 59 | |
| } | |
| const resKey = await axios.post( | |
| `${this.config.base}/txt2videov3`, | |
| payload, | |
| { | |
| headers: { | |
| 'user-agent': this.config.ua, | |
| authorization: token, | |
| 'content-type': 'application/json' | |
| } | |
| } | |
| ) | |
| if (resKey.data.code !== 0 || !resKey.data.key) | |
| throw 'Gagal mendapatkan task video' | |
| const key = resKey.data.key | |
| for (let i = 0; i < 30; i++) { | |
| const res = await axios.post( | |
| `${this.config.base}/video`, | |
| { keys: [key] }, | |
| { headers: { 'user-agent': this.config.ua, authorization: token } } | |
| ) | |
| const v = res.data.datas?.[0] | |
| if (v?.url) return v.url.trim() | |
| await new Promise(r => setTimeout(r, 3000)) | |
| } | |
| throw 'Video timeout' | |
| } | |
| } | |
| let handler = async (m, { conn, command, text }) => { | |
| if (!text) { | |
| return m.reply( | |
| `🧠 *Txt Ai Info* | |
| Gunakan: | |
| • .txt2img <prompt> | |
| • .txt2vid <prompt> | |
| Contoh: | |
| .t2img anime girl in forest | |
| .t2vid cinematic sunset` | |
| ) | |
| } | |
| try { | |
| await m.reply('⏳ Memproses...') | |
| if (command === 'txt2img') { | |
| const img = await AgungDevX.text2img(text) | |
| return conn.sendMessage( | |
| m.chat, | |
| { image: { url: img }, caption: '🖼️ AI Image Generated' }, | |
| { quoted: m } | |
| ) | |
| } | |
| if (command === 'txt2vid') { | |
| const vid = await AgungDevX.text2video(text) | |
| return conn.sendMessage( | |
| m.chat, | |
| { video: { url: vid }, caption: '🎬 AI Video Generated' }, | |
| { quoted: m } | |
| ) | |
| } | |
| } catch (e) { | |
| console.error(e) | |
| m.reply('❌ Gagal memproses AI') | |
| } | |
| } | |
| handler.command = ['txt2img', 'txt2vid'] | |
| handler.tags = ['ai'] | |
| handler.help = ['txt2img <prompt>', 'txt2vid <prompt>'] | |
| export default handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment