woy - Wasted On Youtube
Wanna know how badly addicted you are to youtube? Woy will tell you how much of your time you wasted watching videos, with several stats (and plots!) about channels, tags, weekly watchtime, and so on.
It works by scraping your youtube watch history (obtained with Google Takeout) and complementing with extra info about the videos (obtained with the Youtube API).
Setup
First, ask google for your data: click on your avatar on the top right of youtube, then Your data in Youtube, then More under Your Youtube dashboard, and finally Download Youtube Data. In the next page, make sure to click on "multiple formats" and change the "history" dropdown from HTML to JSON. Do whatever you prefer for the next steps, and you should soon receive your data via the chosen method. The history file will be located at Takeout/YouTube and YouTube Music/history/watch-history.json inside the extracted directory.
In order to use the youtube API you'll need your own API key (or alternative, ask for a friend's 😉). To do so, I recommend following the official guide up to point 3.; you can skip setting up OAuth authentication, as it won't be needed.
Once you have your Takeout and your API key, you're ready to go! Install woy with pip (or your preferred method, I suggest uv):
pip install woy
Usage
To scrape your history and download the additional info, run (this is only needed once!):
woy fetch <PATH_TO_TAKEOUT_HISTORY_JSON> <API_KEY>
This will create a file called youtube_watch_history.csv in the current directory with all the history data. Feel free to peruse it and a analyse it however you like!
To generate a summary, prepare to cringe and run:
woy process
There are many options! Run woy process -h to see all the available options to customize the summary.
For example, to include only the data starting from 2020, and exclude videos categorized as "Music", run:
woy process --exclude-categories "Music" -f 2020-01-01
Caveats
Youtube Takeout unfortunately does not include playback information, such as exact minutes watched and playback speed. This means that every time a video is watched "a bit", it's counted as a full watch. As a result, watch times are always overestimated, resulting for example in days where the watchtime is longer than 24h. As far as I know, there's no way around it.
You can partly offset this by passing the -a (--adjust-watch-time) option, which will cut down the duration of a video if another video was started before it could have ended at a normal pace. So, if you started a 2 hour video at 12:00 and another one at 13:00, it will assume that only 1 hour was spent on the first video. Depending on your watching habits, this might cut down dramatically the watch time.
Metadata
Release files for woy 1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| woy-1.4.tar.gz | 22.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| woy-1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.7 kB
Release files / woy-1.4.tar.gz
| Download URL | woy-1.4.tar.gz |
|---|---|
| Size | 22.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
90f67e07b07620bf3a885fde3d33a4df42cc2210f4085ddbc6e2f72f04ca42e7
|
|
BLAKE2b-256 checksum How to use checksums |
be5eb96a75101ded3630c3d7d01f2bcae18a3813ab2a0c98c694e87e3ef1a5ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Release files / woy-1.4-py3-none-any.whl
| Download URL | woy-1.4-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec6135e3bcef19898804ae1798586c897898fd9f1a8aca0a47fd0cfe1f113089
|
|
BLAKE2b-256 checksum How to use checksums |
b65db194ea32928ef20d56082d691fcfb7ec88e5b2015fe1090cdbb51195ea07
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|