https://github.com/brisvag/woy

Wasted On Youtube.

https://github.com/brisvag/woy

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.7%) to scientific vocabulary

Keywords from Contributors

projection interactive archival generic sequences observability autograding hacking shellcodes modular
Last synced: 11 months ago · JSON representation

Repository

Wasted On Youtube.

Basic Info
  • Host: GitHub
  • Owner: brisvag
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 53.7 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created over 1 year ago · Last pushed 12 months ago
Metadata Files
Readme License

README.md

woy - Wasted On Youtube

License PyPI Python Version

asciicast

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>

[!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!

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.

Owner

  • Name: Lorenzo Gaifas
  • Login: brisvag
  • Kind: user
  • Company: @gutsche-lab

PhD student at @gutsche-lab, doing computational stuff with cryo-ET data.

GitHub Events

Total
  • Delete event: 4
  • Public event: 1
  • Push event: 10
  • Pull request event: 5
  • Create event: 5
Last Year
  • Delete event: 4
  • Public event: 1
  • Push event: 10
  • Pull request event: 5
  • Create event: 5

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 17
  • Total Committers: 2
  • Avg Commits per committer: 8.5
  • Development Distribution Score (DDS): 0.176
Past Year
  • Commits: 17
  • Committers: 2
  • Avg Commits per committer: 8.5
  • Development Distribution Score (DDS): 0.176
Top Committers
Name Email Commits
Lorenzo Gaifas b****g@g****m 14
dependabot[bot] 4****] 3

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 0
  • Pull requests: 3
  • Average time to close issues: N/A
  • Average time to close pull requests: about 1 hour
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 3
Top Authors
Issue Authors
Pull Request Authors
  • dependabot[bot] (7)
Top Labels
Issue Labels
Pull Request Labels
dependencies (7) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 29 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: woy

Wasted On Youtube

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 29 Last month
Rankings
Dependent packages count: 9.9%
Average: 32.9%
Dependent repos count: 55.9%
Maintainers (1)
Last synced: 11 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • softprops/action-gh-release v2 composite
pyproject.toml pypi
  • click *
  • google-api-python-client *
  • numpy *
  • pandas *
  • plotly *
  • rich *