How rockyroad1827/bookstacks-youtube-video-sync works
This repository syncs YouTube channel videos into a configured BookStack book, organizing playlist videos into chapters and uncategorized videos at the book root. The main script also detects already-synced videos, supports forced deletion and resync, and can run a recycle-bin purge. The README documents OAuth token setup and the purge workflow; excerpts show selected API operations but omit much of the main script, so uncertain internal call wiring is not expanded.
Main entry points: Sync Public Videos.py Sync coordinator · oauth2 token.py OAuth token helper · purge_recycle_bin.sh Recycle-bin purge · purge_query.sql Purge query
Components 17
Video Sync
- Sync coordinator
Sync Public Videos.py - Playlist discovery
Sync Public Videos.py - Video details
Sync Public Videos.py - Playlist grouping
Sync Public Videos.py - Existing page scan
Sync Public Videos.py - Chapter management
Sync Public Videos.py - Page management
Sync Public Videos.py
Authentication
- OAuth token helper
oauth2 token.py - Token file
Purge
- Purge invocation
Sync Public Videos.py - Recycle-bin purge
purge_recycle_bin.sh - Purge query
purge_query.sql
Other components
- Operator
- YouTube API
- BookStack API
- Google OAuth
- BookStack database
Connections 19
- Operator → Sync coordinator: runs sync
- Sync coordinator → Playlist discovery: collects playlists
- Playlist discovery → YouTube API: requests playlists
- Sync coordinator → Video details: gets video details
- Video details → YouTube API: requests videos
- Sync coordinator → Playlist grouping: groups videos
- Sync coordinator → Existing page scan: checks duplicates
- Existing page scan → BookStack API: reads book pages
- Sync coordinator → Chapter management: syncs playlists
- Chapter management → BookStack API: creates chapters
- Sync coordinator → Page management: syncs videos
- Page management → BookStack API: creates pages
- Operator → OAuth token helper: starts login
- OAuth token helper → Google OAuth: authenticates
- OAuth token helper → Token file: saves credentials
- Operator → Purge invocation: runs sync
- Purge invocation → Recycle-bin purge: executes script
- Recycle-bin purge → Purge query: uses query
- Purge query → BookStack database: purges records