This project automates the creation and uploading of YouTube videos directly from news articles. It scrapes the given news article URL, generates a video script, converts text to audio, creates visuals, combines them into a video, and uploads the final video to YouTube using the YouTube Data API. This is intended for educational purposes only.
- News Article Scraping: Extracts content from a given news article URL.
- Script Generation: Automatically generates a script based on the article.
- Image Generation: Creates images using the Flux model based on the script.
- Text-to-Speech Conversion: Converts the script into audio using advanced TTS models.
- Video Creation: Combines generated audio and images into a video.
- YouTube Upload: Automatically uploads the final video to YouTube with a generated title and description.
- Input: Provide a news article URL.
- Article Scraping: Extract the text content using
fetch_article.py. - Script Generation: Use GPT models to generate a script, prompts, and a YouTube title and description.
- Image Generation: Use the Flux model to generate images based on prompts.
- Audio Creation: Convert the script to audio using TTS models.
- Video Assembly: Combine images and audio into a video.
- YouTube Upload: Use the YouTube Data API to upload the video with appropriate metadata.
- Python 3.9+
- Poetry (for dependency management)
- GPT Model, YouTube Data API credentials
- GPU-enabled server for image generation
-
Clone the repository:
git clone <repository_url> cd <repository_name>
-
Install dependencies using Poetry:
poetry install
-
Set up environment variables:
- Create a
.envfile in the root directory. - Add required API keys and configuration values.
- Create a
-
Configure the Flux model:
- Set up a comfyui server with the Flux model enabled (or change your model accordingly).
- Edit the
main.pyfile to include your desired news article URL. - Install Poetry using pip:
pip install poetry
- Run the pipeline:
poetry run python src/bot/main.py
- Check the generated video in the
src/bot/directory and confirm its upload status on YouTube.
- Logging: Modify
logging_config.iniin theconfigdirectory to adjust log levels and formatting. - Flux Model: Update
flux_dev.jsonfor custom workflows or image generation parameters. - YouTube Privacy Settings: Adjust the
yt_privacy_statusvariable inmain.pyto set video visibility (public,private, orunlisted).
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or contributions, please create an issue or submit a pull request!