[BUG] YouTube Shorts stuck in infinite "Generated Title is too long" loop on Windows

Author: gamingwithmemeplay-aiCreated May 31, 2026Updated Jun 9, 2026

Bug Report: YouTube Shorts stuck in infinite "Generated Title is too long" loop on Windows

Environment:

  • OS: Windows 11
  • Python: 3.12.13
  • MoneyPrinterV2 branch: main

What I did (step by step)

  1. Cloned the repo and copied config.example.json to config.json
  2. Created a virtual environment with python -m venv venv and activated it
  3. Installed dependencies with pip install -r requirements.txt
  4. Configured config.json with:
    • nanobanana2_api_key: valid Gemini API key
    • nanobanana2_model: tried both gemini-3.1-flash-image-preview and gemini-1.5-flash
    • imagemagick_path: correct path to magick.exe
    • ollama_model: llama3 (Ollama installed and running)
  5. Fixed selenium compatibility error by downgrading to selenium==4.15.0
  6. Fixed moviepy error by installing moviepy==1.0.3
  7. Added geckodriver.exe to the project root folder
  8. Added geckodriver path to PATH with set PATH=%PATH%;C:\Users\...\MoneyPrinterV2-main
  9. Set HF_TOKEN environment variable with a valid HuggingFace token
  10. Successfully reached the YouTube Shorts menu and selected "Upload Short"

What happens

After selecting "Upload Short", the program downloads the TTS voice models correctly, but then gets stuck in an infinite loop:

Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
⚠️ Generated Title is too long. Retrying...
⚠️ Generated Title is too long. Retrying...
⚠️ Generated Title is too long. Retrying...

This loop never ends. I left it running for over 40 minutes and it never progressed past this point.


What I tried to fix it

  • Changed nanobanana2_model from gemini-3.1-flash-image-preview to gemini-1.5-flash → same result
  • Set HF_TOKEN environment variable → same result
  • Restarted the program multiple times → same result

Questions

  1. Is there a maximum title length configured somewhere that I can adjust?
  2. Is gemini-3.1-flash-image-preview still a supported model string for the Gemini API?
  3. Is there a way to debug what title is being generated before it gets rejected?

Thank you!

Source: FujiwaraChoki/MoneyPrinterV2