Personal YouTube subscriptions scraper that ranks videos and generates a static feed.
Project description
YouTube subscriptions viewer
A local web app that displays your YouTube subscription videos sorted by a nowcast ranking algorithm tuned for ad hoc runs.
Ranking Algorithm
Videos are ranked by a core score designed for ad hoc runs and then filtered by the selected facet window (2 days, 1 week, 2 weeks, 1 month). This means each facet shows the strongest videos within that window, not a globally recency-biased list.
Core score components:
-
Nowcast vs Expected (55% weight)
- Compares current views to age-adjusted expected views from each channel's
baseline_48h.
- Compares current views to age-adjusted expected views from each channel's
-
Velocity Shock (20% weight)
- Compares current views/hour to expected slope at the video's current age.
-
Subscriber Reach (15% weight)
- Views relative to subscriber count with diminishing returns.
-
Duration Prior (5% weight)
- Lightweight bias for durations that tend to produce stable performance.
Score modifiers:
- Confidence multiplier (0.75-1.05) lowers rank impact for weak parse confidence/stale baselines.
- Early breakout boost (up to +0.12) helps very new videos that are simultaneously strong in nowcast and velocity.
Notes:
- Facet sorting uses facet score keys (
day,week,twoweeks,month) backed by the core score. - Freshness diagnostics are still recorded in details for transparency, but recency is not applied as a hard rank penalty across wider windows.
Overview
A tool to track YouTube subscriptions and surface high-performing videos. It consists of:
- A channel stats scraper that collects subscriber counts and a channel
baseline_48hproxy - A video scraper that collects new videos from subscribed channels
- Observation tracking per scrape run for better point-in-time ranking
- A static page generator that creates a feed of videos sorted by performance
Quick start (recommended: uvx)
You can run the tool directly with uvx — no cloning and no manual installs:
uvx ytsubs@latest scrape-channels
uvx ytsubs@latest scrape-videos
uvx ytsubs@latest open
Setup (local dev)
-
Requirements:
- Python 3.12+
- Google Chrome browser
-
(Optional) Install tool versions with mise:
mise install
- Install dependencies with uv:
uv sync
Database reset
If local schema/data gets out of sync, reset your local DB:
rm -f ~/.local/state/ytsubs/youtube.db
Usage
First-time setup
Run these commands in order:
uv run ytsubs scrape-channels # When Chrome opens, log in to YouTube
uv run ytsubs scrape-videos # Collect recent videos and generate the feed
uv run ytsubs open # Open the feed in your browser
Your YouTube login is saved in ~/.local/state/ytsubs/chrome_profile (or $XDG_STATE_HOME/ytsubs/chrome_profile), so you'll only need to log in once. Subsequent runs will reuse this profile.
Regular usage
- Collect video data:
uv run ytsubs scrape-videos # Run daily to get new videos
- Update channel statistics (subscriber counts and baseline views):
uv run ytsubs scrape-channels # Run occasionally (e.g., monthly)
- Open the feed:
uv run ytsubs open # Opens the latest feed
The feed is written to ~/.local/state/ytsubs/ytsubs_feed.html (or $XDG_STATE_HOME/ytsubs/ytsubs_feed.html).
Data locations (XDG)
- Chrome profile:
~/.local/state/ytsubs/chrome_profile(or$XDG_STATE_HOME/ytsubs/chrome_profile) - SQLite DB:
~/.local/state/ytsubs/youtube.db(or$XDG_STATE_HOME/ytsubs/youtube.db) - Feed output:
~/.local/state/ytsubs/ytsubs_feed.html(or$XDG_STATE_HOME/ytsubs/ytsubs_feed.html)
Debug tooling
uv run ytsubs debug-scrape --scrolls 4 --filter "gymkhana"
Development
The project uses:
- SQLite for data storage
- Playwright for web scraping
- Preact for the frontend (served statically)
Makefile commands
The project includes several helpful make commands:
make clean: Remove Python cache filesmake reset-db: Reset database to empty tablesmake reset-videos: Clear only the videos tablemake reset-channels: Clear only the channels table
Requirements
- Python 3.12+
- Google Chrome
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytsubs-0.2.4.tar.gz.
File metadata
- Download URL: ytsubs-0.2.4.tar.gz
- Upload date:
- Size: 39.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b63057d2b814594dd4c11d81ac2603fc19fe1239449cb8b40064d4f2687c398
|
|
| MD5 |
4560accf6d5391a8c8dd6c10a622af7b
|
|
| BLAKE2b-256 |
1683c051c3e5bd8f15638a53c0cf0c3d6b89574b9fad2e04cfb089b181102e2b
|
Provenance
The following attestation bundles were made for ytsubs-0.2.4.tar.gz:
Publisher:
publish.yml on shayne/ytsubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytsubs-0.2.4.tar.gz -
Subject digest:
1b63057d2b814594dd4c11d81ac2603fc19fe1239449cb8b40064d4f2687c398 - Sigstore transparency entry: 1480008754
- Sigstore integration time:
-
Permalink:
shayne/ytsubs@1a876a14f09669bf28dc75640a23f06feb48f272 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shayne
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1a876a14f09669bf28dc75640a23f06feb48f272 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ytsubs-0.2.4-py3-none-any.whl.
File metadata
- Download URL: ytsubs-0.2.4-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba38d93d2c49677738d4bec2c6ab9561ffd9903d5b8f909c6871e2c9d42c73a4
|
|
| MD5 |
29e5bda033610410b1767477bc899dc6
|
|
| BLAKE2b-256 |
9ccfd0a350e1196e65d02f21b672fea8c220a45748e52594dc9585dabbc157a2
|
Provenance
The following attestation bundles were made for ytsubs-0.2.4-py3-none-any.whl:
Publisher:
publish.yml on shayne/ytsubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ytsubs-0.2.4-py3-none-any.whl -
Subject digest:
ba38d93d2c49677738d4bec2c6ab9561ffd9903d5b8f909c6871e2c9d42c73a4 - Sigstore transparency entry: 1480008967
- Sigstore integration time:
-
Permalink:
shayne/ytsubs@1a876a14f09669bf28dc75640a23f06feb48f272 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/shayne
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1a876a14f09669bf28dc75640a23f06feb48f272 -
Trigger Event:
workflow_dispatch
-
Statement type: