This project converts YouTube videos into articles. It consists of three main scripts that are executed in the main.py
file:
-
download.py
: This script is responsible for downloading the YouTube videos. It uses the YouTube Data API to download the videos and extract the transcripts. -
articles.py
: This script generates articles and short descriptions from the downloaded YouTube transcripts. It uses Ollama with llama3 to generate the articles. -
upload.py
: This script uploads the generated articles to Medium. It uses the Medium API to publish the articles.
Setup
To set up the project, follow these steps:
-
Clone the repository:
git clone https://github.com/AurelDeveloper/medium_auto_publisher.git cd medium_auto_publisher
-
Take a pull of Ollama docker image and run it:
docker pull ollama/ollama docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
-
To start or stop the Ollama docker image:
docker start ollama docker stop ollama
-
Add the llama3 LLM model in Ollama:
curl http://localhost:11434/api/pull -d '{"name": "llama3"}'
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
-
Install the required Python libraries:
pip install -r requirements.txt
-
Copy the
.env.example
file to.env
:cp .env.example .env
-
Open the
.env
file and replace the placeholders with your actual values.
Running the Project
To run the project, simply execute the main.py
script:
python3 main.py