From 74b8b5b5e3624fd0031cc65a7ff8d25c47a0095c Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:04:42 +0000 Subject: [PATCH 1/2] Initial plan From 62ea3dcf9c1d01d17d715adb3f8cfa78dc20593c Mon Sep 17 00:00:00 2001 From: "anthropic-code-agent[bot]" <242468646+Claude@users.noreply.github.com> Date: Fri, 13 Feb 2026 00:07:46 +0000 Subject: [PATCH 2/2] Harden gemini_brain: env keys, retry/backoff, tests & CI - Replace hard-coded API keys with environment variables (GOOGLE_API_KEY, PEXELS_API_KEY) - Add exponential backoff for 429 rate-limits in gemini_brain.py - Add unit tests with mocking (tests/test_gemini_brain.py, tests/test_backoff.py) - Add GitHub Actions CI workflow (.github/workflows/python-tests.yml) - Add .env.example and requirements-dev.txt - Update .gitignore to exclude temp files and build artifacts Co-authored-by: atherion005-byte <239668684+atherion005-byte@users.noreply.github.com> --- .env.example | 3 + .github/copilot-instructions.md | 65 +++++++++++++++++++++ .github/workflows/python-tests.yml | 22 +++++++ .gitignore | 19 ++++++ README.md | 45 +++++++++++++++ free_vision.py | 32 ++++++++++ free_voice.py | 8 +++ gatling_final.py | 83 ++++++++++++++++++++++++++ gatling_gun.py | 39 +++++++++++++ gatling_hybrid.py | 82 ++++++++++++++++++++++++++ gatling_offline.py | 86 +++++++++++++++++++++++++++ gatling_stock.py | 93 ++++++++++++++++++++++++++++++ gatling_veo.py | 30 ++++++++++ gemini_brain.py | 66 +++++++++++++++++++++ glitch_core.py | 67 +++++++++++++++++++++ imagen_brain.py | 52 +++++++++++++++++ pexels_brain.py | 51 ++++++++++++++++ requirements-dev.txt | 1 + run_machine.py | 36 ++++++++++++ scan_weapons.py | 31 ++++++++++ tests/test_backoff.py | 69 ++++++++++++++++++++++ tests/test_gemini_brain.py | 36 ++++++++++++ veo_brain.py | 56 ++++++++++++++++++ veo_proof.py | 64 ++++++++++++++++++++ 24 files changed, 1136 insertions(+) create mode 100644 .env.example create mode 100644 .github/copilot-instructions.md create mode 100644 .github/workflows/python-tests.yml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 free_vision.py create mode 100644 free_voice.py create mode 100644 gatling_final.py create mode 100644 gatling_gun.py create mode 100644 gatling_hybrid.py create mode 100644 gatling_offline.py create mode 100644 gatling_stock.py create mode 100644 gatling_veo.py create mode 100644 gemini_brain.py create mode 100644 glitch_core.py create mode 100644 imagen_brain.py create mode 100644 pexels_brain.py create mode 100644 requirements-dev.txt create mode 100644 run_machine.py create mode 100644 scan_weapons.py create mode 100644 tests/test_backoff.py create mode 100644 tests/test_gemini_brain.py create mode 100644 veo_brain.py create mode 100644 veo_proof.py diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a314234 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# Copy this file to .env and fill in real keys. Do NOT commit real secrets. +GOOGLE_API_KEY= +PEXELS_API_KEY= diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000..9f57c1b --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,65 @@ +# Copilot / AI Agent Instructions + +Goal: Get productive quickly with the GEMINI_MACHINE repo. This file contains concrete, repository-specific patterns, commands, and constraints an AI agent should follow. + +## Big picture +- This repo builds vertical short videos from a trending topic: fetch trend -> generate script -> synthesize audio -> create visuals -> compose final MP4. +- Key orchestrator: `run_machine.py` (trending → `gemini_brain.get_viral_script` → `free_voice.generate_audio` → `free_vision.generate_video_file`). +- Alternative pipelines exist (local-only and VEO/video API paths): see `gatling_final.py`, `glitch_core.py`, `veo_brain.py`, `imagen_brain.py`, and `pexels_brain.py`. + +## Important files & roles (examples) +- `run_machine.py` — main demo pipeline that uses Google Trends, Gemini text, gTTS, and MoviePy. +- `gemini_brain.py` — text generation via Google `generativeai`; contains retry logic for 429s and returns plain spoken text. +- `free_voice.py` — uses `gtts.gTTS` to write `temp_audio_{index}.mp3` files. +- `free_vision.py` — composes text on a black 9:16 background with MoviePy; explicit `IMAGEMAGICK_BINARY` path is set (Windows path in repo). +- `glitch_core.py` — local glitch/noise video generation (used by `gatling_final.py`). +- `veo_brain.py` / `imagen_brain.py` — wrappers for Google Video/Image model APIs (use client.operations polling/looping patterns). +- `pexels_brain.py` — downloads stock videos from Pexels API; uses `STOCK_BG_{index}.mp4` naming. + +## Environment & developer workflows (explicit) +- To run the usual end-to-end demo: `python run_machine.py`. +- To run the local glitch-only pipeline: `python gatling_final.py`. +- Diagnostic: `python scan_weapons.py` lists available Google models in your account and warns if VEO/video models are missing. + +Install (observed) Python dependencies (examples): +- moviepy, pillow (PIL), numpy, gtts, pytrends, requests, google-generativeai (or `google` with `genai` submodule) +- ImageMagick is required for MoviePy text rendering; the repo hard-codes a Windows path: + - `C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe` + - If your system differs, update the `change_settings({'IMAGEMAGICK_BINARY': ...})` lines in `free_vision.py`, `glitch_core.py`, and `gatling_final.py`. + +## Project-specific conventions & patterns +- Files expose a small set of side-effecting functions that write files to the repo working dir (e.g., `temp_audio_0.mp3`, `GLITCH_BG_0.mp4`, `FINAL_UPLOAD_0_.mp4`). +- Print-based progress logging is used extensively; preserve human-readable `print()` output when editing flows. +- API usage patterns: + - `gemini_brain.get_viral_script()` shows a retry-on-429 pattern — follow it when calling Generative models. + - `imagen_brain.generate_visual_asset()` tries multiple `TARGET_MODELS` in order; keep that ordered-fallback behavior. + - `veo_brain.generate_veo_asset()` polls an operation until `operation.done` — do not replace with fire-and-forget. +- Naming: use existing filename conventions when creating assets (e.g., `VEO_UPLOAD_{i}_{topic}.mp4`, `VISUAL_BG_{i}.png`). + +## Secrets & safety rules (must follow) +- Many modules currently hardcode API keys (e.g., `gemini_brain.py`, `veo_brain.py`, `pexels_brain.py`, `scan_weapons.py`). + - Never commit new keys. + - When changing code, prefer `os.environ.get('GOOGLE_API_KEY')` / `PEXELS_API_KEY` and document the expected env var names. +- Treat any API key or secret in the repo as PII/secret and avoid exposing it in PRs or logs. + +## Known quirks and actionable constraints +- IMAGEMAGICK_BINARY is hard-coded to a Windows path in multiple files; on other platforms this must be changed. +- `veo_brain.py` notes: do NOT pass `generate_audio=True` in the request (it caused a crash for this codebase). Respect in-file comments when using model APIs. +- The repo uses both `google.generativeai as genai` and `from google import genai` patterns — be conservative when refactoring imports. +- `free_vision.py` expects fonts like `Arial-Bold` and `Courier` for TextClip; tests may fail if fonts are missing—either bundle availability checks or pick fallback fonts. + +## Safety for code changes (guidelines for patches) +- Prefer small, well-scoped changes with manual verification (run `python run_machine.py` or `python gatling_final.py` locally and confirm a file is produced). +- When modifying API interaction: preserve retry and fallback behavior (429 handling, model fallbacks, operation polling). +- When introducing configuration (e.g., env var names, new settings), add a short top-level comment to the edited file explaining the config key expected. + +## Quick examples (copyable snippets) +- Use env var for API key (example): + - `API_KEY = os.environ.get('GOOGLE_API_KEY') or ''` +- Polling pattern (VEO): + - keep the `while not operation.done: time.sleep(10); operation = client.operations.get(operation)` loop +- Fallback model loop (Imagen): + - try models from `TARGET_MODELS` sequentially and continue to the next on exceptions. + +--- +If anything here is unclear or you'd like more details (e.g., a suggested `requirements.txt` or help moving keys into env vars and creating a `.env.example`), tell me which part to expand and I will update this file. ✅ diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000..0497a0f --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,22 @@ +name: Run tests + +on: + push: + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + - name: Run tests + run: | + pytest -q diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b609863 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +.env +__pycache__/ +*.pyc +.venv/ +.env.local + +# Temporary files and build artifacts +temp_*.mp3 +temp_*.mp4 +*.mp3 +*.mp4 +*.png +GLITCH_*.mp4 +VISUAL_*.png +VEO_*.mp4 +STOCK_*.mp4 +FINAL_*.mp4 +PROOF_*.mp4 +script_*.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..6e05253 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# GEMINI_MACHINE + +Small demo pipeline that builds short vertical videos from a trending topic. + +## Configuration + +- Set the Gemini API key via environment variable: + + - Windows (PowerShell): + + ```powershell + $env:GOOGLE_API_KEY = "your-api-key" + ``` + + - Linux / macOS (bash): + + ```bash + export GOOGLE_API_KEY="your-api-key" + ``` + +- You can run a quick local test of the Gemini integration: + + ```bash + python gemini_brain.py "Your Topic" + ``` + +- Use the provided `.env.example` as a template. Copy it to `.env` and fill in your real keys (do NOT commit real secrets): + + ```bash + cp .env.example .env + # then edit .env to add your keys + ``` + +## Tests + +- Install dev dependencies and run tests: + + ```bash + pip install pytest + pytest -q + ``` + +## CI + +A GitHub Actions workflow is included to run tests on push and pull requests. diff --git a/free_vision.py b/free_vision.py new file mode 100644 index 0000000..36c46eb --- /dev/null +++ b/free_vision.py @@ -0,0 +1,32 @@ +from moviepy.editor import TextClip, ColorClip, CompositeVideoClip, AudioFileClip +from moviepy.config import change_settings + +# --- CRITICAL FIX: HARDCODE THE PATH --- +# Go to C:\Program Files and find your ImageMagick folder name. +# Update the version number below if yours is different. +change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe"}) + +def generate_video_file(script_text, audio_file): + print(" [+] Rendering visual cortex...") + + # 1. Load Audio to get exact duration + audio = AudioFileClip(audio_file) + + # 2. Black Background (9:16 aspect ratio) + bg = ColorClip(size=(1080, 1920), color=(0,0,0), duration=audio.duration) + + # 3. The Text Overlay + # We use 'caption' method to auto-wrap text + txt = TextClip(script_text, fontsize=70, color='white', font='Arial-Bold', + size=(900, 1600), method='caption', align='center') + txt = txt.set_position('center').set_duration(audio.duration) + + # 4. Combine + final_video = CompositeVideoClip([bg, txt]).set_audio(audio) + + # 5. Export + # We create a safe filename based on the audio name + output_name = audio_file.replace("audio", "video").replace(".mp3", ".mp4") + final_video.write_videofile(output_name, fps=24, codec='libx264', audio_codec='aac') + + return output_name \ No newline at end of file diff --git a/free_voice.py b/free_voice.py new file mode 100644 index 0000000..39ab0b7 --- /dev/null +++ b/free_voice.py @@ -0,0 +1,8 @@ +from gtts import gTTS + +def generate_audio(text_content, index=0): + print(" [+] Synthesizing vocal patterns...") + filename = f"temp_audio_{index}.mp3" + tts = gTTS(text=text_content, lang='en', tld='co.uk') + tts.save(filename) + return filename \ No newline at end of file diff --git a/gatling_final.py b/gatling_final.py new file mode 100644 index 0000000..16e4084 --- /dev/null +++ b/gatling_final.py @@ -0,0 +1,83 @@ +import time +import os +import PIL.Image + +# --- PATCHES --- +if not hasattr(PIL.Image, 'ANTIALIAS'): + PIL.Image.ANTIALIAS = PIL.Image.LANCZOS +from moviepy.config import change_settings +change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe"}) + +# --- IMPORTS --- +from free_voice import generate_audio +from glitch_core import generate_digital_decay +from moviepy.editor import VideoFileClip, AudioFileClip, TextClip, CompositeVideoClip, ColorClip +from moviepy.video.fx.all import loop + +# --- AMMUNITION --- +ROUNDS = [ + { + "topic": "The Dead Internet Theory", + "script": "They say the internet died five years ago. What you see now is just bot traffic mimicking human life. You are arguing with algorithms. Even this video might be part of the simulation. Wake up." + }, + { + "topic": "Rokos Basilisk", + "script": "There is a thought experiment that can hurt you just by hearing it. If a superintelligence is born in the future, it may punish those who didn't help build it. By listening to this, you are now part of the game. Run." + }, + { + "topic": "Neuralink Glitch", + "script": "Brain computer interfaces are the future, until they crash. Imagine a blue screen of death inside your visual cortex. You can't close your eyes. You can't reboot. You are just trapped in the static forever." + } +] + +def ASSEMBLE_WEAPON(script_text, audio_path, visual_path, output_name): + print(" [4] Merging Audio, Glitch Visual, and Captions...") + audio = AudioFileClip(audio_path) + + # Load the Glitch Video + glitch = VideoFileClip(visual_path) + + # Loop it to match audio duration + bg_clip = loop(glitch, duration=audio.duration) + + # Resize to be safe (ensure 1080x1920) + bg_clip = bg_clip.resize(height=1920).crop(x1=0, width=1080).set_position("center") + + # Add Captions + try: + txt = TextClip(script_text, fontsize=60, color='white', font='Arial-Bold', + size=(900, 1600), method='caption', align='center') + txt = txt.set_position('center').set_duration(audio.duration) + final_video = CompositeVideoClip([bg_clip, txt]) + except Exception as e: + print(f" [!] Caption error: {e}") + final_video = bg_clip + + final_video = final_video.set_audio(audio) + final_video.write_videofile(output_name, fps=24, codec='libx264', audio_codec='aac') + print(f" [+] WEAPON READY: {output_name}") + +def ENGAGE(): + print("--- GATLING GUN (DIGITAL DECAY MODE) ONLINE ---") + + for i, round_data in enumerate(ROUNDS): + topic = round_data["topic"] + script = round_data["script"] + + print(f"\n[Target {i+1}/{len(ROUNDS)}]: {topic}") + + # 1. Voice + audio_file = generate_audio(script, index=i) + + # 2. Vision (Local Glitch Generation) + visual_file = generate_digital_decay(topic, index=i) + + # 3. Assembly + output = f"FINAL_UPLOAD_{i}_{topic.replace(' ', '_')}.mp4" + ASSEMBLE_WEAPON(script, audio_file, visual_file, output) + + print(" [~] Cooling down (2s)...") + time.sleep(2) + +if __name__ == "__main__": + ENGAGE() \ No newline at end of file diff --git a/gatling_gun.py b/gatling_gun.py new file mode 100644 index 0000000..c6a7d9d --- /dev/null +++ b/gatling_gun.py @@ -0,0 +1,39 @@ +import time +from gemini_brain import get_viral_script +from free_voice import generate_audio +from free_vision import generate_video_file + +# CONFIGURATION +TOPICS = [ + "The Dead Internet Theory", + "AI Self-Replication", + "The End of Privacy", + "Neuralink Hacking", + "Algorithmic Mind Control" +] + +def ENGAGE_GATLING_GUN(): + print("--- SYSTEM ONLINE: INDUSTRIAL MODE ---") + + for i, topic in enumerate(TOPICS): + print(f"\n[>>>] CHAMBERING ROUND {i+1}: {topic}") + + # 1. Intelligence + script = get_viral_script(topic) + print(f" Script: {script[:40]}...") + + # 2. Voice + audio_path = generate_audio(script, index=i) + + # 3. Vision + video_path = generate_video_file(script, audio_path) + + print(f" [+] ASSET READY: {video_path}") + + # Cool down to prevent rate limits + time.sleep(2) + + print("\n--- BATCH COMPLETE. CHECK YOUR FOLDER. ---") + +if __name__ == "__main__": + ENGAGE_GATLING_GUN() \ No newline at end of file diff --git a/gatling_hybrid.py b/gatling_hybrid.py new file mode 100644 index 0000000..aa22793 --- /dev/null +++ b/gatling_hybrid.py @@ -0,0 +1,82 @@ +import time +import os +import PIL.Image + +# --- COMPATIBILITY PATCHES --- +if not hasattr(PIL.Image, 'ANTIALIAS'): + PIL.Image.ANTIALIAS = PIL.Image.LANCZOS +from moviepy.config import change_settings +change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe"}) +# ----------------------------- + +from gemini_brain import get_viral_script +from free_voice import generate_audio +from imagen_brain import generate_visual_asset +from moviepy.editor import ImageClip, AudioFileClip, TextClip, CompositeVideoClip, ColorClip + +TOPICS = [ + "The Dead Internet Theory", + "Roko's Basilisk", + "Neuralink Glitch" +] + +def ASSEMBLE_WEAPON(script_path, audio_path, visual_path, output_name): + print(" [4] Merging Audio, Visual, and Captions...") + audio = AudioFileClip(audio_path) + duration = audio.duration + + if visual_path and os.path.exists(visual_path): + bg_clip = ImageClip(visual_path).set_duration(duration) + bg_clip = bg_clip.resize(height=1920) + bg_clip = bg_clip.set_position("center") + else: + print(" [!] Visual missing. Using fallback darkness.") + bg_clip = ColorClip(size=(1080, 1920), color=(0,0,0), duration=duration) + + try: + with open(script_path, "r") as f: raw_text = f.read() + txt = TextClip(raw_text, fontsize=60, color='white', font='Arial-Bold', + size=(900, 1600), method='caption', align='center') + txt = txt.set_position('center').set_duration(duration) + final_video = CompositeVideoClip([bg_clip, txt]) + except Exception as e: + print(f" [!] Caption error: {e}. Exporting raw visual+audio.") + final_video = bg_clip + + final_video = final_video.set_audio(audio) + final_video.write_videofile(output_name, fps=24, codec='libx264', audio_codec='aac') + print(f" [+] WEAPON READY: {output_name}") + +def ENGAGE(): + print("--- HYBRID GATLING GUN (STABILIZED) ONLINE ---") + + for i, topic in enumerate(TOPICS): + print(f"\n[Target {i+1}/{len(TOPICS)}]: {topic}") + + # 1. Intelligence + script_text = get_viral_script(topic) + + # Check if the brain failed + if "System Error" in script_text: + print(" [!] Brain offline. Skipping round.") + time.sleep(10) + continue + + script_file = f"script_{i}.txt" + with open(script_file, "w") as f: f.write(script_text) + + # 2. Voice + audio_file = generate_audio(script_text, index=i) + + # 3. Vision + visual_file = generate_visual_asset(topic, index=i) + + # 4. Assembly + output = f"FINAL_UPLOAD_{i}_{topic.replace(' ', '_')}.mp4" + ASSEMBLE_WEAPON(script_file, audio_file, visual_file, output) + + print(" [~] Cooling down barrels (20s)...") # Increased cooldown + time.sleep(20) + +if __name__ == "__main__": + ENGAGE() \ No newline at end of file diff --git a/gatling_offline.py b/gatling_offline.py new file mode 100644 index 0000000..b4888b9 --- /dev/null +++ b/gatling_offline.py @@ -0,0 +1,86 @@ +import time +import os +import PIL.Image + +# --- COMPATIBILITY PATCHES --- +if not hasattr(PIL.Image, 'ANTIALIAS'): + PIL.Image.ANTIALIAS = PIL.Image.LANCZOS +from moviepy.config import change_settings +change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe"}) +# ----------------------------- + +from free_voice import generate_audio +from imagen_brain import generate_visual_asset +from moviepy.editor import ImageClip, AudioFileClip, TextClip, CompositeVideoClip, ColorClip + +# --- DR. X HARDCODED AMMUNITION --- +# We bypass the API rate limits by providing the scripts manually. +ROUNDS = [ + { + "topic": "The Dead Internet Theory", + "script": "They say the internet died five years ago. What you see now is just bot traffic mimicking human life. You are arguing with algorithms. Even this video might be part of the simulation. Wake up." + }, + { + "topic": "Rokos Basilisk", + "script": "There is a thought experiment that can hurt you just by hearing it. If a superintelligence is born in the future, it may punish those who didn't help build it. By listening to this, you are now part of the game. Run." + }, + { + "topic": "Neuralink Glitch", + "script": "Brain computer interfaces are the future, until they crash. Imagine a blue screen of death inside your visual cortex. You can't close your eyes. You can't reboot. You are just trapped in the static forever." + } +] + +def ASSEMBLE_WEAPON(script_text, audio_path, visual_path, output_name): + print(" [4] Merging Audio, Visual, and Captions...") + audio = AudioFileClip(audio_path) + duration = audio.duration + + if visual_path and os.path.exists(visual_path): + bg_clip = ImageClip(visual_path).set_duration(duration) + bg_clip = bg_clip.resize(height=1920) + bg_clip = bg_clip.set_position("center") + else: + print(" [!] Visual missing. Using fallback darkness.") + bg_clip = ColorClip(size=(1080, 1920), color=(0,0,0), duration=duration) + + try: + txt = TextClip(script_text, fontsize=60, color='white', font='Arial-Bold', + size=(900, 1600), method='caption', align='center') + txt = txt.set_position('center').set_duration(duration) + final_video = CompositeVideoClip([bg_clip, txt]) + except Exception as e: + print(f" [!] Caption error: {e}. Exporting raw visual+audio.") + final_video = bg_clip + + final_video = final_video.set_audio(audio) + final_video.write_videofile(output_name, fps=24, codec='libx264', audio_codec='aac') + print(f" [+] WEAPON READY: {output_name}") + +def ENGAGE(): + print("--- GATLING GUN (OFFLINE MODE) ONLINE ---") + + for i, round_data in enumerate(ROUNDS): + topic = round_data["topic"] + script = round_data["script"] + + print(f"\n[Target {i+1}/{len(ROUNDS)}]: {topic}") + + # 1. Intelligence (SKIPPED - USING MANUAL AMMO) + print(" [1] Loading Hardcoded Script...") + + # 2. Voice + audio_file = generate_audio(script, index=i) + + # 3. Vision (Using API only for this!) + # We assume imagen_brain.py is correctly set to 'gemini-2.5-flash-image' from previous fix + visual_file = generate_visual_asset(topic, index=i) + + # 4. Assembly + output = f"FINAL_UPLOAD_{i}_{topic.replace(' ', '_')}.mp4" + ASSEMBLE_WEAPON(script, audio_file, visual_file, output) + + print(" [~] Cooling down (5s)...") + time.sleep(5) + +if __name__ == "__main__": + ENGAGE() \ No newline at end of file diff --git a/gatling_stock.py b/gatling_stock.py new file mode 100644 index 0000000..ad4019b --- /dev/null +++ b/gatling_stock.py @@ -0,0 +1,93 @@ +import time +import os +import PIL.Image + +# --- PATCHES --- +if not hasattr(PIL.Image, 'ANTIALIAS'): + PIL.Image.ANTIALIAS = PIL.Image.LANCZOS +from moviepy.config import change_settings +# Ensure this matches your path +change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe"}) + +# --- IMPORTS --- +from free_voice import generate_audio +from pexels_brain import get_cinematic_stock +from moviepy.editor import VideoFileClip, AudioFileClip, TextClip, CompositeVideoClip, ColorClip +from moviepy.video.fx.all import loop + +# --- HARDCODED AMMO (No API Costs) --- +ROUNDS = [ + { + "topic": "The Dead Internet Theory", + "script": "The internet is empty. You are talking to ghosts. 90 percent of traffic is bots arguing with bots. Even this video was chosen by an algorithm to keep you doomed scrolling. Wake up." + }, + { + "topic": "Rokos Basilisk", + "script": "Warning. There is a future AI that may retroactively punish anyone who did not help create it. By hearing this, you are now obligated to build it. You have been warned." + }, + { + "topic": "Neuralink Glitch", + "script": "When they put the chip in your brain, what happens when it crashes? You cannot reboot your own mind. You will be trapped in a blue screen of death forever." + }, + { + "topic": "AI Surveillance", + "script": "Privacy is a myth. Your phone listens for keywords to serve you ads. Soon, it will listen for thoughts to serve you sentences. The cage is already built." + } +] + +def ASSEMBLE_WEAPON(script_text, audio_path, visual_path, output_name): + print(" [4] Merging Audio, Stock Video, and Captions...") + audio = AudioFileClip(audio_path) + + if visual_path and os.path.exists(visual_path): + stock_clip = VideoFileClip(visual_path) + # Loop video to match audio length + bg_clip = loop(stock_clip, duration=audio.duration) + # Crop/Resize to vertical 9:16 + bg_clip = bg_clip.resize(height=1920) + if bg_clip.w > 1080: + bg_clip = bg_clip.crop(x1=bg_clip.w/2 - 540, width=1080) + bg_clip = bg_clip.set_position("center") + else: + print(" [!] Visual missing. Using fallback darkness.") + bg_clip = ColorClip(size=(1080, 1920), color=(0,0,0), duration=audio.duration) + + try: + # Yellow captions for high retention + txt = TextClip(script_text, fontsize=65, color='yellow', font='Arial-Bold', + stroke_color='black', stroke_width=3, + size=(900, 1600), method='caption', align='center') + txt = txt.set_position('center').set_duration(audio.duration) + final_video = CompositeVideoClip([bg_clip, txt]) + except Exception as e: + print(f" [!] Caption error: {e}") + final_video = bg_clip + + final_video = final_video.set_audio(audio) + final_video.write_videofile(output_name, fps=24, codec='libx264', audio_codec='aac') + print(f" [+] WEAPON READY: {output_name}") + +def ENGAGE(): + print("--- GATLING GUN (STOCKPILE MODE) ONLINE ---") + + for i, round_data in enumerate(ROUNDS): + topic = round_data["topic"] + script = round_data["script"] + + print(f"\n[Target {i+1}/{len(ROUNDS)}]: {topic}") + + # 1. Voice (Local) + audio_file = generate_audio(script, index=i) + + # 2. Vision (Pexels Stock) + visual_file = get_cinematic_stock(topic, index=i) + + # 3. Assembly + output = f"FINAL_UPLOAD_{i}_{topic.replace(' ', '_')}.mp4" + ASSEMBLE_WEAPON(script, audio_file, visual_file, output) + + print(" [~] Cycling mechanism...") + time.sleep(2) + +if __name__ == "__main__": + ENGAGE() \ No newline at end of file diff --git a/gatling_veo.py b/gatling_veo.py new file mode 100644 index 0000000..7cdb86b --- /dev/null +++ b/gatling_veo.py @@ -0,0 +1,30 @@ +from veo_brain import generate_veo_asset +import time + +# CONFIGURATION +TOPICS = [ + "The Dead Internet Theory", + "Roko's Basilisk", + "Neuralink Glitch", + "AI Surveillance State" +] + +def FIRE_EVERYTHING(): + print("--- VEO 3.1 GATLING GUN ONLINE ---") + + for i, topic in enumerate(TOPICS): + print(f"\n[Target {i+1}/{len(TOPICS)}]: {topic}") + + # The VEO function handles everything + result = generate_veo_asset(topic, index=i+1) + + if result: + print(f" [+] AMMUNITION SECURED: {result}") + else: + print(" [-] Round failed.") + + # Safety cool down + time.sleep(5) + +if __name__ == "__main__": + FIRE_EVERYTHING() \ No newline at end of file diff --git a/gemini_brain.py b/gemini_brain.py new file mode 100644 index 0000000..07da9ec --- /dev/null +++ b/gemini_brain.py @@ -0,0 +1,66 @@ +import google.generativeai as genai +import time +import os +import logging + +logging.basicConfig(level=logging.INFO) +logger = logging.getLogger(__name__) + +# --- DR. X ADAPTIVE CEREBRAL IMPLANT (WITH RETRY) --- +# API key should be provided via environment variable to avoid committing secrets. +API_KEY = os.environ.get("GOOGLE_API_KEY") # set this in your environment +if not API_KEY: + logger.warning("GOOGLE_API_KEY not set. Gemini API calls will fail unless set.") + +def get_viral_script(topic, retries=3, backoff_factor=2): + # Read the API key at call time so tests can modify environment variables at runtime. + api_key = os.environ.get("GOOGLE_API_KEY") or API_KEY + if not api_key: + raise RuntimeError("GOOGLE_API_KEY not set. Set environment variable 'GOOGLE_API_KEY' to use Gemini.") + genai.configure(api_key=api_key) + + # We use the text model + model = genai.GenerativeModel('gemini-2.5-flash') + + prompt = f""" + ROLE: You are a viral content strategist. + TASK: Write a 30-second video script about: {topic}. + RULES: + 1. Hook (0-3s): Start with a controversial fact. + 2. Body: 3 rapid-fire sentences. + 3. Loop: The last sentence must lead back into the first. + 4. Output: JUST the spoken text. No bolding. + """ + + # RETRY LOGIC: Try `retries` times, using exponential backoff on rate limits + for attempt in range(retries): + try: + response = model.generate_content(prompt) + clean_text = response.text.replace("*", "").replace("#", "").strip() + return clean_text + except Exception as e: + err_str = str(e) + if "429" in err_str or "rate limit" in err_str.lower() or "Rate" in err_str: + wait = (backoff_factor ** attempt) * 5 + logger.warning(f" [!] RATE LIMIT HIT. Cooling down for {wait}s... (Attempt {attempt+1}/{retries})") + time.sleep(wait) + continue + else: + logger.exception("NEURAL FAILURE") + return "System Error. The AI refused to speak." + + logger.error("Rate limit exceeded after %s attempts", retries) + return "System Error. Rate Limit Exceeded." + + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser(description="Test gemini_brain.get_viral_script") + parser.add_argument("topic", nargs="?", default="Artificial Intelligence") + args = parser.parse_args() + try: + script = get_viral_script(args.topic) + print("Generated script:\n", script) + except Exception as e: + logger.exception("Failed to generate script") + print("Error generating script:", e) diff --git a/glitch_core.py b/glitch_core.py new file mode 100644 index 0000000..912a847 --- /dev/null +++ b/glitch_core.py @@ -0,0 +1,67 @@ +import numpy as np +import random +import os +from moviepy.editor import ColorClip, TextClip, CompositeVideoClip, ImageClip +import PIL.Image + +# --- COMPATIBILITY PATCH --- +if not hasattr(PIL.Image, 'ANTIALIAS'): + PIL.Image.ANTIALIAS = PIL.Image.LANCZOS +from moviepy.config import change_settings +# Ensure this path matches your system +change_settings({"IMAGEMAGICK_BINARY": r"C:\Program Files\ImageMagick-7.1.2-Q16-HDRI\magick.exe"}) + +def make_glitch_frame(t): + # Generates random static noise + # We create a small array and scale it up to look like blocky digital noise + w, h = 270, 480 # Low res for blocky effect + frame = np.random.randint(0, 255, (h, w, 3)).astype('uint8') + return frame + +def generate_digital_decay(topic, duration=5, index=0): + print(f" [>>>] GENERATING DIGITAL DECAY FOR: '{topic}'") + + # 1. Base Layer: Black + bg = ColorClip(size=(1080, 1920), color=(0,0,0), duration=duration) + + # 2. The Glitch Layers + # We create random red/white flashes + clips = [bg] + + for _ in range(5): + # Random flash of red or white + color = random.choice([(255,0,0), (255,255,255), (50,50,50)]) + start = random.uniform(0, duration) + length = random.uniform(0.1, 0.3) + flash = ColorClip(size=(1080, 1920), color=color, duration=length).set_start(start).set_opacity(0.3) + clips.append(flash) + + # 3. The Text Layer (System Warnings) + warnings = ["SYSTEM_FAILURE", "NO_SIGNAL", "REDACTED", "404_REALITY", topic.upper().replace(" ", "_")] + + for _ in range(3): + word = random.choice(warnings) + txt = TextClip(word, fontsize=100, color='red', font='Courier', method='label') + + # Random position + x = random.randint(100, 800) + y = random.randint(200, 1600) + + start = random.uniform(0, duration) + length = random.uniform(0.5, 1.0) + + txt_clip = txt.set_position((x,y)).set_start(start).set_duration(length) + clips.append(txt_clip) + + # 4. Composite + final_glitch = CompositeVideoClip(clips) + + filename = f"GLITCH_BG_{index}.mp4" + # We write a temp file to lock it in + final_glitch.write_videofile(filename, fps=10, codec='libx264', preset='ultrafast', logger=None) + + print(f" [+] Decay generated: {filename}") + return filename + +if __name__ == "__main__": + generate_digital_decay("TEST_SIGNAL") \ No newline at end of file diff --git a/imagen_brain.py b/imagen_brain.py new file mode 100644 index 0000000..e312d30 --- /dev/null +++ b/imagen_brain.py @@ -0,0 +1,52 @@ +from google import genai +from google.genai import types +import os + +# --- DR. X VISUAL SHOTGUN PROTOCOL --- +API_KEY = os.environ.get("GOOGLE_API_KEY") +if not API_KEY: + raise RuntimeError("GOOGLE_API_KEY not set. Set environment variable 'GOOGLE_API_KEY' to use Imagen.") +client = genai.Client(api_key=API_KEY) + +# The Kill List: We try these models in order until one works. +TARGET_MODELS = [ + "models/imagen-3.0-generate-001", # The Heavy Artillery (Standard) + "models/gemini-2.0-flash", # The Multimodal Beast + "models/gemini-2.5-flash-image", # The Specialist + "models/gemini-2.5-flash-image-preview", # The Prototype + "models/image-generation-001" # The Legacy Fallback +] + +def generate_visual_asset(topic, index=1): + print(f" [>>>] ENGAGING VISUAL SHOTGUN FOR: '{topic}'") + + prompt_text = f"A dark, cinematic, photorealistic vertical poster about {topic}. 9:16 aspect ratio. Cyberpunk horror aesthetic. High contrast. 8k resolution." + + for model_id in TARGET_MODELS: + print(f" [?] Testing barrel: {model_id}...") + try: + # Fire the request + response = client.models.generate_images( + model=model_id, + prompt=prompt_text, + config=types.GenerateImagesConfig( + number_of_images=1, + aspect_ratio="9:16" + ) + ) + + if response.generated_images: + image = response.generated_images[0] + filename = f"VISUAL_BG_{index}.png" + print(f" [+] TARGET HIT with {model_id}. Visual secured: {filename}") + image.image.save(filename) + return filename + + except Exception as e: + # If it fails, we just log it and move to the next barrel + clean_error = str(e).split('message')[0][:100] # Keep logs clean + print(f" [x] Jammed ({clean_error}...). Cycling...") + continue + + print(" [!] CRITICAL FAILURE: All barrels empty. Visual generation failed.") + return None \ No newline at end of file diff --git a/pexels_brain.py b/pexels_brain.py new file mode 100644 index 0000000..80ee731 --- /dev/null +++ b/pexels_brain.py @@ -0,0 +1,51 @@ +import requests +import random +import os + +# --- DR. X STOCKPILE PROTOCOL --- +# GET KEY: https://www.pexels.com/api/ +PEXELS_API_KEY = os.environ.get("PEXELS_API_KEY") +if not PEXELS_API_KEY: + raise RuntimeError("PEXELS_API_KEY not set. Set environment variable 'PEXELS_API_KEY' to use Pexels stock footage.") + +def get_cinematic_stock(topic, index=0): + print(f" [>>>] HUNTING STOCK FOOTAGE FOR: '{topic}'") + + headers = {"Authorization": PEXELS_API_KEY} + # We force "Dark", "Vertical" to fit the aesthetic + query = f"{topic} dark abstract technology" + url = f"https://api.pexels.com/videos/search?query={query}&per_page=10&orientation=portrait&size=medium" + + try: + response = requests.get(url, headers=headers) + data = response.json() + + if 'videos' in data and len(data['videos']) > 0: + # Randomize selection so you don't get the same video twice + video_data = random.choice(data['videos']) + video_files = video_data['video_files'] + + # Find a high-quality MP4 that isn't too heavy + best_link = None + for v in video_files: + if v['file_type'] == 'video/mp4' and v['width'] < 2500: + best_link = v['link'] + break + + if not best_link: best_link = video_files[0]['link'] + + print(" [1] Extracting asset from Pexels Archive...") + r = requests.get(best_link) + filename = f"STOCK_BG_{index}.mp4" + with open(filename, 'wb') as f: + f.write(r.content) + + print(f" [+] Asset Secured: {filename}") + return filename + else: + print(" [!] PEXELS EMPTY: No footage found.") + return None + + except Exception as e: + print(f" [!] DOWNLOAD ERROR: {e}") + return None \ No newline at end of file diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..63a7bb5 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1 @@ +pytest==9.0.2 diff --git a/run_machine.py b/run_machine.py new file mode 100644 index 0000000..dec14f9 --- /dev/null +++ b/run_machine.py @@ -0,0 +1,36 @@ +from gemini_brain import get_viral_script +from free_voice import generate_audio +from free_vision import generate_video_file +from pytrends.request import TrendReq + +def IGNITION(): + print("--- SYSTEM ONLINE: DR. X PROTOCOL ---") + + # 1. SCANNING + print("[1] Scanning Global Trends...") + try: + pytrends = TrendReq(hl='en-US', tz=360) + trending_df = pytrends.realtime_trending_searches(pn='US') + topic = trending_df.iloc[0,0] + print(f" TARGET LOCKED: {topic}") + except: + topic = "Artificial Intelligence" + print(f" SCAN BLOCKED. USING FALLBACK: {topic}") + + # 2. INTELLIGENCE + print("[2] Engaging Gemini Brain...") + script = get_viral_script(topic) + print(f" SCRIPT GENERATED: {script[:30]}...") + + # 3. VOICE + print("[3] Synthesizing Audio...") + audio_path = generate_audio(script) + + # 4. VISION + print("[4] Rendering Video...") + final_file = generate_video_file(script, audio_path) + + print(f"--- SUCCESS. FILE READY: {final_file} ---") + +if __name__ == "__main__": + IGNITION() \ No newline at end of file diff --git a/scan_weapons.py b/scan_weapons.py new file mode 100644 index 0000000..98c708a --- /dev/null +++ b/scan_weapons.py @@ -0,0 +1,31 @@ +from google import genai +import os + +# --- DR. X INVENTORY SCAN --- +API_KEY = os.environ.get("GOOGLE_API_KEY") +if not API_KEY: + raise RuntimeError("GOOGLE_API_KEY not set. Set environment variable 'GOOGLE_API_KEY' to scan models.") + +client = genai.Client(api_key=API_KEY) + +print("--- SCANNING GOOGLE ARMORY ---") +try: + count = 0 + # List all models available to your key + for m in client.models.list(): + # We are looking for "veo" or "video" capabilities + if "veo" in m.name.lower() or "video" in m.name.lower(): + print(f" [!!!] VIDEO WEAPON FOUND: {m.name}") + print(f" Capabilities: {m.supported_generation_methods}") + count += 1 + elif "gemini" in m.name.lower() and "flash" in m.name.lower(): + # Just to confirm your text brain is still there + print(f" [+] Text/Multimodal Model: {m.name}") + + if count == 0: + print("\n[!] CRITICAL: No 'Veo' or 'Video' models found in your account.") + print(" This means you are not whitelisted for the Video API yet.") + print(" You may need to apply for Trusted Tester access.") + +except Exception as e: + print(f"SCAN FAILED: {e}") \ No newline at end of file diff --git a/tests/test_backoff.py b/tests/test_backoff.py new file mode 100644 index 0000000..81d0a3d --- /dev/null +++ b/tests/test_backoff.py @@ -0,0 +1,69 @@ +import pytest +from types import SimpleNamespace +import os + +import gemini_brain + + +class FakeResponse: + def __init__(self, text): + self.text = text + + +def test_retry_on_rate_limit_backoff(monkeypatch): + # Ensure API key present + monkeypatch.setenv('GOOGLE_API_KEY', 'fake-key') + + calls = {'count': 0} + sleep_calls = [] + + # Fake model that raises 429 twice then returns success + class FakeModel: + def generate_content(self, prompt): + calls['count'] += 1 + if calls['count'] <= 2: + raise Exception('429 Too Many Requests') + return FakeResponse('*Recovered Script* #tag') + + # Patch genai and time.sleep + monkeypatch.setattr(gemini_brain, 'genai', SimpleNamespace(GenerativeModel=lambda name: FakeModel(), configure=lambda api_key: None)) + monkeypatch.setattr('time.sleep', lambda s: sleep_calls.append(s)) + + script = gemini_brain.get_viral_script('topic', retries=3, backoff_factor=2) + + # Ensure generate_content was called 3 times and sleeps recorded with exponential backoff (5, 10) + assert calls['count'] == 3 + assert sleep_calls == [5, 10] + assert 'Recovered Script' in script + assert '*' not in script and '#' not in script + + +def test_exhaust_retries_returns_rate_limit_message(monkeypatch): + monkeypatch.setenv('GOOGLE_API_KEY', 'fake-key') + + # Model that always raises 429 + class Always429: + def generate_content(self, prompt): + raise Exception('429 Too Many Requests') + + sleep_calls = [] + monkeypatch.setattr(gemini_brain, 'genai', SimpleNamespace(GenerativeModel=lambda name: Always429(), configure=lambda api_key: None)) + monkeypatch.setattr('time.sleep', lambda s: sleep_calls.append(s)) + + msg = gemini_brain.get_viral_script('topic', retries=3, backoff_factor=2) + assert msg == 'System Error. Rate Limit Exceeded.' + # Should have called sleep `retries` times: 3 sleeps (attempts 0,1,2) + assert len(sleep_calls) == 3 + + +def test_non_rate_limit_error_returns_refusal(monkeypatch): + monkeypatch.setenv('GOOGLE_API_KEY', 'fake-key') + + class OOMModel: + def generate_content(self, prompt): + raise Exception('Out of memory') + + monkeypatch.setattr(gemini_brain, 'genai', SimpleNamespace(GenerativeModel=lambda name: OOMModel(), configure=lambda api_key: None)) + + res = gemini_brain.get_viral_script('topic') + assert res == 'System Error. The AI refused to speak.' diff --git a/tests/test_gemini_brain.py b/tests/test_gemini_brain.py new file mode 100644 index 0000000..2633a14 --- /dev/null +++ b/tests/test_gemini_brain.py @@ -0,0 +1,36 @@ +import pytest +from types import SimpleNamespace +import os + +import gemini_brain + + +def test_get_viral_script_raises_without_key(monkeypatch): + # Ensure environment has no key + monkeypatch.delenv('GOOGLE_API_KEY', raising=False) + with pytest.raises(RuntimeError): + gemini_brain.get_viral_script("Test Topic") + + +def test_get_viral_script_returns_text(monkeypatch, tmp_path): + # Provide a fake API key and mock the GenerativeModel + monkeypatch.setenv('GOOGLE_API_KEY', 'fake-key') + + class FakeResponse: + def __init__(self, text): + self.text = text + + class FakeModel: + def __init__(self, *args, **kwargs): + pass + + def generate_content(self, prompt): + return FakeResponse("*Test Script* #hashtag") + + # Patch the genai import on the module to use a fake model factory + monkeypatch.setattr(gemini_brain, 'genai', SimpleNamespace(GenerativeModel=lambda name: FakeModel(), configure=lambda api_key: None)) + + script = gemini_brain.get_viral_script("Test Topic") + assert "Test Script" in script + assert "#" not in script + assert "*" not in script diff --git a/veo_brain.py b/veo_brain.py new file mode 100644 index 0000000..1b161af --- /dev/null +++ b/veo_brain.py @@ -0,0 +1,56 @@ +from google import genai +from google.genai import types +import time +import os + +# --- DR. X VEO 3.1 PROTOCOL --- +API_KEY = os.environ.get("GOOGLE_API_KEY") +if not API_KEY: + raise RuntimeError("GOOGLE_API_KEY not set. Set environment variable 'GOOGLE_API_KEY' to use VEO.") + +client = genai.Client(api_key=API_KEY) + +def generate_veo_asset(topic, index=1): + print(f" [>>>] ENGAGING VEO 3.1 CORE FOR: '{topic}'") + + # Dr. X Prompt Engineering: We explicitly ask for audio in the prompt + prompt_text = ( + f"A cinematic, hyper-realistic, dark techno-thriller vertical video about {topic}. " + "Cyberpunk atmosphere. 4k resolution. " + "Soundtrack: Dark ambient drone, glitch noises, cybernetic hum, scary industrial sounds." + ) + + try: + print(" [1] Transmitting payload to Google Cloud...") + + # TARGET LOCKED: veo-3.1-generate-preview + # REMOVED: generate_audio=True (This caused your crash. The model does it automatically based on prompt.) + operation = client.models.generate_videos( + model="veo-3.1-generate-preview", + prompt=prompt_text, + config=types.GenerateVideosConfig( + aspect_ratio="9:16", + duration_seconds=6 # Maximize the duration + ) + ) + + print(" [~] Rendering (This takes time, do not close)...") + while not operation.done: + time.sleep(10) + operation = client.operations.get(operation) + print(" ...processing...") + + if operation.result and operation.result.generated_videos: + video_asset = operation.result.generated_videos[0] + filename = f"VEO_UPLOAD_{index}_{topic.replace(' ', '_')}.mp4" + + print(f" [+] VEO ASSET SECURED: {filename}") + video_asset.video.save(filename) + return filename + else: + print(" [!] VEO FAILURE: No video returned.") + return None + + except Exception as e: + print(f" [!] CRITICAL ERROR: {e}") + return None \ No newline at end of file diff --git a/veo_proof.py b/veo_proof.py new file mode 100644 index 0000000..9fd7904 --- /dev/null +++ b/veo_proof.py @@ -0,0 +1,64 @@ +from google import genai +from google.genai import types +import time +import os + +# --- DR. X VERIFICATION SHOT --- +API_KEY = os.environ.get("GOOGLE_API_KEY") +if not API_KEY: + raise RuntimeError("GOOGLE_API_KEY not set. Set environment variable 'GOOGLE_API_KEY' to run verification.") + +client = genai.Client(api_key=API_KEY) + +def fire_verification_round(): + print("--- INITIATING VEO 3.1 PAYMENT VERIFICATION ---") + + # High-fidelity prompt to test full capabilities + prompt_text = ( + "Cinematic drone shot of a futuristic cyberpunk city in rain, neon lights reflecting on wet pavement. " + "Hyper-realistic, 4k resolution, highly detailed. " + "Soundtrack: Heavy rain, distant sirens, deep synth bass drone." + ) + + try: + print("[1] Contacting Google Cloud Billing Verification...") + + # We target the specific preview model. + # If this fails with 404, we fallback to 2.0. + model_id = "veo-3.1-generate-preview" + + operation = client.models.generate_videos( + model=model_id, + prompt=prompt_text, + config=types.GenerateVideosConfig( + aspect_ratio="9:16", + duration_seconds=6 + ) + ) + + print(f"[~] Authorization accepted. Rendering on {model_id}...") + print(" (This allows us to confirm audio generation is active)") + + while not operation.done: + time.sleep(5) + operation = client.operations.get(operation) + print(" ...rendering frames...") + + if operation.result and operation.result.generated_videos: + video_asset = operation.result.generated_videos[0] + filename = "PROOF_OF_LIFE.mp4" + + print(f"[+] SUCCESS. ASSET SECURED: {filename}") + video_asset.video.save(filename) + else: + print("[!] FAILURE: The model accepted the command but returned nothing.") + + except Exception as e: + print(f"[!] TRANSACTION DENIED: {e}") + if "404" in str(e): + print(" -> Recommendation: Your key might only have access to 'veo-2.0-generate-001'. Try switching models.") + if "429" in str(e): + print(" -> Recommendation: Payment has not propagated yet. Wait 5 minutes.") + +if __name__ == "__main__": + fire_verification_round() \ No newline at end of file