Name | woy JSON |
Version |
1.3
JSON |
| download |
home_page | None |
Summary | Wasted On Youtube |
upload_time | 2024-12-12 22:28:41 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | GPLv3 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# woy - Wasted On Youtube
[![License](https://img.shields.io/pypi/l/woy.svg?color=green)](https://github.com/brisvag/woy/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/woy.svg?color=green)](https://pypi.org/project/woy)
[![Python Version](https://img.shields.io/pypi/pyversions/woy.svg?color=green)](https://python.org)
[![asciicast](https://asciinema.org/a/A8QR33m8LjbkkrD20a6c1ox8B.svg)](https://asciinema.org/a/A8QR33m8LjbkkrD20a6c1ox8B)
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](https://takeout.google.com/)) and complementing with extra info about the videos (obtained with the [Youtube API](https://developers.google.com/youtube/v3)).
## 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](https://developers.google.com/youtube/v3/getting-started) 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](https://docs.astral.sh/uv/)):
```
pip install woy
```
## Usage
To scrape your history and download the additional info, run:
```
woy fetch <PATH_TO_TAKEOUT_HISTORY_JSON> <API_KEY>
```
> [!WARNING]
> By default your API will have a quota of 10k requests per day. This should be plenty for this purpose, as woy tries to be smart about it and batch requests, but you won't be able to use the same API key many times in the same day. That should be ok though, since you only need to do this once! Anyway, you'll get a confirmation prompt telling you how much api quota this run will use.
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
```
> [!TIP]
> Video titles and channel names are clickable links!
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "woy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Lorenzo Gaifas <brisvag@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/6b/15/a2f0611b873a2f7015a01ea94904ff590b8d43f749ec1a310e774b1382a4/woy-1.3.tar.gz",
"platform": null,
"description": "# woy - Wasted On Youtube\n\n[![License](https://img.shields.io/pypi/l/woy.svg?color=green)](https://github.com/brisvag/woy/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/woy.svg?color=green)](https://pypi.org/project/woy)\n[![Python Version](https://img.shields.io/pypi/pyversions/woy.svg?color=green)](https://python.org)\n\n[![asciicast](https://asciinema.org/a/A8QR33m8LjbkkrD20a6c1ox8B.svg)](https://asciinema.org/a/A8QR33m8LjbkkrD20a6c1ox8B)\n\nWanna 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.\n\nIt works by scraping your youtube watch history (obtained with [Google Takeout](https://takeout.google.com/)) and complementing with extra info about the videos (obtained with the [Youtube API](https://developers.google.com/youtube/v3)).\n\n## Setup\n\nFirst, 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.\n\nIn order to use the youtube API you'll need your own API key (or alternative, ask for a friend's \ud83d\ude09). To do so, I recommend following [the official guide](https://developers.google.com/youtube/v3/getting-started) up to point `3.`; you can skip setting up OAuth authentication, as it won't be needed.\n\nOnce you have your Takeout and your API key, you're ready to go! Install woy with pip (or your preferred method, I suggest [uv](https://docs.astral.sh/uv/)):\n\n```\npip install woy\n```\n\n## Usage\n\nTo scrape your history and download the additional info, run:\n\n```\nwoy fetch <PATH_TO_TAKEOUT_HISTORY_JSON> <API_KEY>\n```\n\n> [!WARNING]\n> By default your API will have a quota of 10k requests per day. This should be plenty for this purpose, as woy tries to be smart about it and batch requests, but you won't be able to use the same API key many times in the same day. That should be ok though, since you only need to do this once! Anyway, you'll get a confirmation prompt telling you how much api quota this run will use.\n\nThis 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!\n\nTo generate a summary, prepare to cringe and run:\n```\nwoy process\n```\n\n> [!TIP]\n> Video titles and channel names are clickable links!\n\nRun `woy process -h` to see all the available options to customize the summary.\n\nFor example, to include only the data starting from 2020, and exclude videos categorized as \"Music\", run:\n\n```\nwoy process --exclude-categories \"Music\" -f 2020-01-01\n```\n\n## Caveats\n\nYoutube 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.\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Wasted On Youtube",
"version": "1.3",
"project_urls": {
"homepage": "https://github.com/brisvag/woy",
"repository": "https://github.com/brisvag/woy"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f47324c46e21cce6a5d766a1205d5ab5188e5dc36e182539a2d143cd2ecd5ee1",
"md5": "f16e90ee02a4eab312fdaa2a2c7f22b1",
"sha256": "1078b2d0a1ae41cf7f61c3e96604e2387d6f83fa986b8d1f97418ff7515ce076"
},
"downloads": -1,
"filename": "woy-1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f16e90ee02a4eab312fdaa2a2c7f22b1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 20008,
"upload_time": "2024-12-12T22:28:36",
"upload_time_iso_8601": "2024-12-12T22:28:36.923109Z",
"url": "https://files.pythonhosted.org/packages/f4/73/24c46e21cce6a5d766a1205d5ab5188e5dc36e182539a2d143cd2ecd5ee1/woy-1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6b15a2f0611b873a2f7015a01ea94904ff590b8d43f749ec1a310e774b1382a4",
"md5": "5f7d7f0cab16c01d8bed61c475e61e1b",
"sha256": "04581d774c55781b03779eb85a603b5a29386d1c311a4a3174f2856a4bd0373a"
},
"downloads": -1,
"filename": "woy-1.3.tar.gz",
"has_sig": false,
"md5_digest": "5f7d7f0cab16c01d8bed61c475e61e1b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 21958,
"upload_time": "2024-12-12T22:28:41",
"upload_time_iso_8601": "2024-12-12T22:28:41.162317Z",
"url": "https://files.pythonhosted.org/packages/6b/15/a2f0611b873a2f7015a01ea94904ff590b8d43f749ec1a310e774b1382a4/woy-1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-12 22:28:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "brisvag",
"github_project": "woy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "woy"
}