A youtube video summarizer using ChatGPT and Youtube APIs. Generate a short mp3 file of the summarized video in ANY languages with a Youtube link
You have to create your own OpenAI api key here and replace it in config.py
file.
pip install -r requirements.txt
python3 main.py <youtube_link> <language> <output_filename='output.mp3'>
python3 main.py https://youtu.be/AyOnug-3OKM es out.mp3
Languages are given in format IETF language tag
I used to split the transcript into several pieces because the context length of openAI api was not big enough to handle a whole video transcript. No need to do it anymore thanks to massive gen ai improvements in less than a year !!!
I should have use JSON to store config and import API key form shell envrionment variable. I will do it sometime. I could take an optional parameter of how long the output file should be.
- 06/07/24:
- Removed gTTS library usage to use openAI text to speech model.
- Now compatible with new version of openAI lib.
- You can now set an output file, if not, it will be name "output.mp3"
- Updated README