Extracts a list of interests based on your YouTube history.
It takes your YouTube history of watched videos as input and returns a CSV file with weighted interests that can be used for visualizations or further analysis.
Note: visualization was not part of the project, I used Flourish Studio to generate a free preview.
You need to download your history and get two API keys. One is YouTube API key to get some extra metadata and the other is OpenAI API key to help with categorization.
- Start by cloning the repository and entering the project directory
- Install python 3 if you don't have it already
- Setup python virtual environment
python -m venv venv
- Activate the virtual environment
source ./venv/bin/activate
- Install python packages
pip install -r requirements.txt
- When downloading your YouTube History from Google Takeout, deselect all other services and set the history format to JSON.
- Unpack the downloaded content, and find
watch-history.json
inYouTube and YouTube Music/history/
and move it to the project root directory - Generate YouTube and OpenAI API keys and paste them into
.env
file in the root of the project
YOUTUBE_API_KEY=***
OPENAI_API_KEY=***
- Run the program
python .