wrolpi/modules/videos
Roland d95249218b Add per-domain and global daily download limits
Adds two optional DownloadManager settings:
- download_daily_limit_per_domain: max non-recurring downloads per domain per day
- download_daily_limit_global: max non-recurring downloads across all domains per day

Recurring Channel/RSS catalog updates are never gated and never counted; only the
videos/archives they spawn and one-off downloads count. Both successful and failed
attempts consume a slot (counted once per download per day). Limits reset at local
midnight (configured timezone). Over-limit downloads stay "new" and resume the next day.

Implementation:
- New Download.last_download_attempt column (+ index, migration) set at dispatch time so
  the count survives restarts and is correct across workers.
- dispatch_downloads gates non-recurring downloads: per-domain skips that domain, global
  stops dispatching counted downloads for the cycle. daily_download_counts derives the
  day's totals from the DB.
- Domain grouping uses normalized URLs via a new Downloader.normalize_domain method
  (base strips www/m/mobile + port); VideoDownloader/ChannelDownloader override it to
  collapse youtu.be, /shorts/, and tracking params to youtube.com. ArchiveDownloader is
  the seam for future archive URL normalization.
- Settings wired through WROLPiConfig, the /settings API (GET/PATCH, non-negative
  validation, 0 = unlimited), and the React Settings page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:17:42 -06:00
..
channel Converting RSS and Video Downloaders to new testable strategy. 2026-05-07 20:07:31 -06:00
test Restore the censored-video search filter (#499) 2026-06-27 09:48:36 -06:00
video Restore the censored-video search filter (#499) 2026-06-27 09:48:36 -06:00
__init__.py Modifying Video/Channel/RSS Downloaders so that they can download videos, but audio only. These audio files are grouped under their channel directories. 2026-04-14 15:33:01 -06:00
api.py Unifying video download settings so that global/channel/rss/video 2026-03-05 17:40:17 -07:00
common.py Trying to get existing channel using more variations of Youtube URLs. 2026-03-20 17:26:51 -06:00
conftest.py Restore the censored-video search filter (#499) 2026-06-27 09:48:36 -06:00
cookies.py Using shared context to sync cookies between processes. 2026-02-22 14:32:27 -07:00
downloader.py Add per-domain and global daily download limits 2026-06-28 17:17:42 -06:00
errors.py Adding toggle to Channel page to stop downloading comments for certain channels. 2025-03-01 18:23:29 -07:00
lib.py chore: address Greptile P2 review comments on PR 449 2026-05-31 13:02:44 -06:00
models.py Models like Archive/Video/Doc can be deleted, even if they are tagged. User is shown a warning and must confirm deletion of tagged files. 2026-05-03 19:14:15 -06:00
normalize_video_url.py A video that is uploaded is attached to its Channel. Saving Channels config with both download url and frequency in case downloads config is corrupted. 2024-10-16 18:56:11 -06:00
schema.py Restore the censored-video search filter (#499) 2026-06-27 09:48:36 -06:00