How juanbindez/pytubefix works
PyTubeFix is a Python library for finding YouTube media, inspecting its metadata and available formats, and downloading video or audio. The main workflow starts with a video URL or ID, retrieves and parses YouTube data, exposes selectable streams, then fetches and saves the chosen media. Separate branches cover search, playlists and channels, captions and other video details, asynchronous access, and SABR streaming. The README documents these capabilities; several internal links below are based on module roles and documented usage rather than sampled call sites.
Main entry points: __init__.py YouTube video · request.py HTTP requests · streams.py Media streams · async_youtube.py Async video
Components 23
User access
- YouTube video
pytubefix/__init__.py - Async video
pytubefix/async_youtube.py
YouTube discovery
- Video search
pytubefix/contrib/search.py - Channel listing
pytubefix/contrib/channel.py - Playlist listing
pytubefix/contrib/playlist.py - Innertube client
pytubefix/innertube.py - HTTP requests
pytubefix/request.py - Page extraction
pytubefix/extract.py - Response parsing
pytubefix/parser.py
Media retrieval
- Stream selection
pytubefix/query.py - Media streams
pytubefix/streams.py - URL deciphering
pytubefix/cipher.py - File output
pytubefix/file_system.py
Video details
- Caption tracks
pytubefix/captions.py - Video metadata
pytubefix/metadata.py - Chapters
pytubefix/chapters.py - Key moments
pytubefix/keymoments.py
Protocol support
- Async HTTP
pytubefix/async_http_client.py - SABR streaming
pytubefix/sabr/core/server_abr_stream.py - BotGuard tokens
pytubefix/botGuard/bot_guard.py - Signature runtime
pytubefix/sig_nsig/node_runner.py
Other components
- Library user
- YouTube API
Connections 28
- Library user → YouTube video: opens video
- Library user → Async video: opens asynchronously
- Library user → Video search: searches
- Library user → Channel listing: opens channel
- Library user → Playlist listing: opens playlist
- YouTube video → Innertube client: requests details
- YouTube video → Page extraction: extracts video data
- Innertube client → HTTP requests: sends requests
- HTTP requests → YouTube API: fetches data
- Page extraction → Response parsing: parses page data
- YouTube video → Stream selection: exposes streams
- Stream selection → Media streams: selects format
- Media streams → URL deciphering: deciphers URLs
- Media streams → HTTP requests: fetches media
- Media streams → File output: writes download
- YouTube video → Caption tracks: provides captions
- YouTube video → Video metadata: provides metadata
- YouTube video → Chapters: provides chapters
- YouTube video → Key moments: provides key moments
- Video search → Innertube client: queries YouTube
- Channel listing → HTTP requests: fetches channel
- Playlist listing → HTTP requests: fetches playlist
- Async video → Async HTTP: requests asynchronously
- Async HTTP → YouTube API: fetches data
- Async video → SABR streaming: uses streaming
- SABR streaming → HTTP requests: requests media
- YouTube video → BotGuard tokens: may generate token
- Media streams → Signature runtime: resolves signatures