[PR #127] [MERGED] Fix generate_script() ignoring retry result #123

Closed
opened 2026-03-02 04:06:53 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/FujiwaraChoki/MoneyPrinterV2/pull/127
Author: @FujiwaraChoki
Created: 2/26/2026
Status: Merged
Merged: 2/26/2026
Merged by: @FujiwaraChoki

Base: mainHead: fix/generate-script-retry-return


📝 Commits (1)

  • daa73a1 Fix generate_script() ignoring retry result when script is too long

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/classes/YouTube.py (+1 -1)

📄 Description

Summary

  • generate_script() calls itself recursively when the generated script exceeds 5000 characters, but the return value was discarded — the original too-long completion always overwrote self.script and was returned regardless.
  • Added the missing return keyword to match the identical retry pattern already used in generate_metadata() (line 211) and generate_prompts() (line 295).

Test plan

  • Generate a video where the LLM produces a script >5000 chars on the first attempt — verify the retry produces a shorter script that is actually used
  • Verify normal script generation (<5000 chars) is unaffected

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/FujiwaraChoki/MoneyPrinterV2/pull/127 **Author:** [@FujiwaraChoki](https://github.com/FujiwaraChoki) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 2/26/2026 **Merged by:** [@FujiwaraChoki](https://github.com/FujiwaraChoki) **Base:** `main` ← **Head:** `fix/generate-script-retry-return` --- ### 📝 Commits (1) - [`daa73a1`](https://github.com/FujiwaraChoki/MoneyPrinterV2/commit/daa73a15ad5340a7e459682ed63f959e446b65e5) Fix generate_script() ignoring retry result when script is too long ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/classes/YouTube.py` (+1 -1) </details> ### 📄 Description ## Summary - `generate_script()` calls itself recursively when the generated script exceeds 5000 characters, but the return value was discarded — the original too-long `completion` always overwrote `self.script` and was returned regardless. - Added the missing `return` keyword to match the identical retry pattern already used in `generate_metadata()` (line 211) and `generate_prompts()` (line 295). ## Test plan - [x] Generate a video where the LLM produces a script >5000 chars on the first attempt — verify the retry produces a shorter script that is actually used - [x] Verify normal script generation (<5000 chars) is unaffected 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:06:53 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/MoneyPrinterV2#123
No description provided.