This project allows you to convert your YouTube watch history HTML file from Google Takeout into a CSV file that can be used by the universalscrobbler.com to Scrobble manually in bulk.
Follow these steps to download your YouTube watch history from Google Takeout:
Create new export
.Deselect all
.All YouTube data included
.Deselect all
.History
.Ok
.Next step
.Send the download link via email
.Export once
..zip
.Create export
.You will receive a .zip
file named takeout-xxxxx-xxx.zip
in your email. Extract the file named watch-history.html
located in the Takeout/Youtube and YouTube Music/history/
directory from the zip file.
To make the script work faster, use tidy
to fix the formatting of the HTML file. Install tidy using:
For apt:
sudo apt install tidy
For brew:
brew install tidy-html5
Then, type this in your terminal:
tidy -indent --indent-spaces 2 -quiet --tidy-mark no watch-history.html > tidy-watch-history.html
This script requires Python 3.7 or higher. Run the setup.sh
to create the environment. After it is done, activate it using this command:
source yt-history-env/bin/activate
Then run the script like this:
python yt-history-to-csv.py tidy-watch-history.html yt-history.csv
To stop the script, press ctrl+c
. To continue the script, run the script again. It will fetch the last progress and continue from that point.
This will convert your YouTube watch history into a CSV file that can be used by the universalscrobbler.com to Scrobble manually in bulk.