const axios = require('axios'); const crypto = require('crypto'); async function veo3(prompt, { image = null } = {}) { try { if (!prompt) throw new Error('Prompt is required'); const { data: cf } = await axios.post('https://cf.nekolabs.my.id/action', { mode: 'turnstile-min', siteKey: '0x4AAAAAAANuFg_hYO9YJZqo', url: 'https://aivideogenerator.me/features/g-ai-video-generator' }); const num = Math.floor(Math.random() * 100) + 1700; const uid = crypto.createHash('md5').update(Date.now().toString()).digest('hex'); const { data: task } = await axios.post('https://aiarticle.erweima.ai/api/v1/secondary-page/api/create', { prompt: prompt, imgUrls: image ? [image] : [], quality: '720p', duration: 8, autoSoundFlag: false, soundPrompt: '', autoSpeechFlag: false, speechPrompt: '', speakerId: 'Auto', aspectRatio: '16:9', secondaryPageId: num, channel: 'VEO3', source: 'aivideogenerator.me', type: 'features', watermarkFlag: true, privateFlag: true, isTemp: true, vipFlag: true, model: 'veo-3-fast' }, { headers: { uniqueid: uid, verify: cf.token } }); while (true) { const { data } = await axios.get(`https://aiarticle.erweima.ai/api/v1/secondary-page/api/${task.data.recordId}`, { headers: { uniqueid: uid, verify: cf.token } }); if (data.data.state === 'fail') return JSON.parse(data.data.completeData); if (data.data.state === 'success') return JSON.parse(data.data.completeData); await new Promise(res => setTimeout(res, 1000)); } } catch (error) { throw new Error(error.message); } } // Usage: const resp = await veo3(`Make it look like the character is being blown by the wind from the front. Don't move the character's position. Make his eyes blink like a real human. the sound of the wind sounds natural like the real world.`, { image: 'https://tmpfiles.org/dl/748691/tmp.jpg' }); console.log(resp);