Skip to content

Conversation

Ravsalt
Copy link

@Ravsalt Ravsalt commented May 11, 2025

Refactors Auto YouTube Shorts Maker with Pollinations API, Video Templates, and Docs Update

This PR overhauls the Auto YouTube Shorts Maker to enhance functionality, simplify setup, and improve maintainability. It introduces the Pollinations AI API for dynamic script and voiceover generation, a template-based system for background gameplay, and updated documentation.

Key Enhancements & Changes:

  • 🤖 New API Integration (shorts.py):

    • Replaced OpenAI/gTTS with the Pollinations AI API for generating engaging, "rage-explain" style scripts and voiceovers based on a user-provided theme.
    • Eliminates the need for an OpenAI API key for core functionality, simplifying setup.
    • Input is now a "theme," with the API handling creative script generation.
  • 🎬 Gameplay Video Templates:

    • Added a templates/ directory, pre-loaded with 39 Minecraft parkour clips (short_*.mp4).
    • The script randomly selects a background video from this directory, ensuring variety.
  • 🛠️ Code Refactoring & Structure (shorts.py):

    • Modularized video and audio processing into distinct functions for better readability and easier future development.
    • Improved error handling and output management (all videos saved to generated/).
    • Standardized short duration to a maximum of 30 seconds.
  • 📄 Updated Documentation (README.md):

    • Completely rewritten to accurately reflect the new workflow, dependencies (Requests, MoviePy, Unidecode), installation, and usage instructions.
    • Clear guidance on using the templates/ folder.
  • ⚙️ Project Configuration:

    • .gitignore updated to include env
    • Removed obsolete .env.example and demo/Demo.mp4.

Benefits:

  • Streamlined User Experience: Easier setup without mandatory API key management for the primary feature.
  • Enhanced Content: More dynamic and engaging short scripts via the new API.
  • Improved Maintainability: Cleaner, more organized codebase.
  • Ready-to-Use Assets: Comes with a collection of gameplay templates.

This update aims to provide a more robust, user-friendly, and creatively flexible tool for generating YouTube Shorts.

@Ravsalt
Copy link
Author

Ravsalt commented May 11, 2025

Consider implementing automatic caption generation for the videos in a future update.
It would be a great accessibility and engagement boost!

@Binary-Bytes
Copy link
Owner

Hey, thank you for your interest in contributing! 😀
I went through code and tested it, and I would like you to make some changes before I merge it.

  1. The generated scripts contain excessive cursing... create a prompt that generates engaging shorts without relying on profanity.
  2. "Generated Script" is printing binary data, instead of the actual script.
  3. Revert the background gameplay code to as it was before, since it was taking out a clip equal to video length from a very large video, it was adding more variety than pre-made 30 sec clips.
  4. There are some sections of the code which are redundant or unreachable, and should be removed.

Please address these points and I will be happy to merge your contribution, thank you!

@Ravsalt
Copy link
Author

Ravsalt commented May 18, 2025

Hey, thanks for the feedback—really appreciate you reviewing the code in depth!

About the cursing: yeah, I added the “rage explain” style on purpose for a bit of humor, but I get that it’s overboard. I’ll tweak the prompt to keep the energy and engagement without relying on profanity.

Quick clarification re: the "Generated Script" printing binary—since I’m using the Pollinations API for audio generation, it doesn’t actually return a text script; it just spits back audio directly. That’s why it ends up printing binary when trying to log the response. I’ll clean that up to avoid confusion and maybe throw in a placeholder or transcript note if needed.

Also, on the background video logic: currently it pulls from a template directory and combines it with the audio automatically. Are you suggesting I revert it to pulling clips from a much larger video instead—like the original version did—so there's more visual variety? Just want to confirm what behavior you’d like restored so I don’t misfire.

I'll also clean up the redundant/unreachable code and streamline it overall.

Thanks again! Let me know if anything else comes up—I’ll push the fixes shortly.

Cheers,
Ravsalt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants