Critical 429 Too Many Requests Error during image generation phase
Author: Badreddine-771Created Jun 1, 2026Updated Jun 6, 2026
Description
When running the script to generate YouTube Shorts, the image generation phase consistently fails and throws a 429 Client Error: Too Many Requests when attempting to call the Nano Banana 2 API (gemini-3.1-flash-image-preview).
Because there is no internal handling for this rate limit, the script fails to download any images, which subsequently breaks the video combination pipeline.
Steps to Reproduce
- Configure
config.jsonwithnanobanana2_modelset to"gemini-3.1-flash-image-preview". - Run
python src/main.pyand choose to generate a Short. - If the script generates a high number of image prompts, the console immediately spams
429 Client Error: Too Many Requestsfor almost every image request.
Expected Behavior
The script should be able to handle API rate limits gracefully without crashing the entire video generation process or leaving the project with 0 downloaded images.
Source: FujiwaraChoki/MoneyPrinterV2