How webrecorder/pywb works
pywb is a Python web-archiving toolkit for replaying archived pages and creating archives. The main user journey is replay: a request enters the Wayback/front-end layer, resolves an archive capture through the WARC server, loads its recorded resource, and rewrites content for browser replay. Separate product branches provide archive indexing, recording, access control, and query/timeline interfaces. The README documents several capabilities whose internal wiring is not shown in the excerpts; those are represented without asserting unsupported call paths.
Main entry points: handlers.py Index/resource handlers · rewriterapp.py Replay handler · html_rewriter.py HTML rewriting · indexsource.py Index sources
Components 21
Replay and serving
- Wayback entry
pywb/apps/wayback.py - Replay frontend
pywb/apps/frontendapp.py - Replay handler
pywb/apps/rewriterapp.py - WARC server
pywb/warcserver/warcserver.py - Index/resource handlers
pywb/warcserver/handlers.py - Capture query
pywb/warcserver/index/query.py - Index sources
pywb/warcserver/index/indexsource.py - Resource loading
pywb/warcserver/resource/responseloader.py - Timeline model and UI
pywb/vueui/src/model.js
Archive management
- Access control
pywb/warcserver/access_checker.py - Collection manager
pywb/manager/manager.py - Archive indexing
pywb/indexer/archiveindexer.py - CDX output
pywb/indexer/cdxindexer.py - ACL administration
pywb/manager/aclmanager.py
Content rewriting
- HTML rewriting
pywb/rewrite/html_rewriter.py - Content rewriting
pywb/rewrite/content_rewriter.py - URL rewriting
pywb/rewrite/url_rewriter.py
Recording
- Recorder app
pywb/recorder/recorderapp.py - Recording filters
pywb/recorder/filters.py - WARC writer
pywb/recorder/multifilewarcwriter.py
Other components
- Archive user
Connections 18
- Archive user → Wayback entry: requests replay
- Wayback entry → Replay frontend: routes requests
- Replay frontend → Replay handler: dispatches replay
- Replay handler → Index/resource handlers: queries captures
- WARC server → Index/resource handlers: dispatches modes
- Index/resource handlers → Index sources: queries index
- Index/resource handlers → Resource loading: loads resource
pywb/warcserver/handlers.py - Index/resource handlers → Access control: filters captures
pywb/warcserver/handlers.py - Capture query → Index sources: forms query
- Collection manager → Index sources: configures collections
- Archive indexing → CDX output: produces entries
pywb/indexer/cdxindexer.py - ACL administration → Collection manager: uses collection manager
pywb/manager/aclmanager.py - Replay handler → HTML rewriting: rewrites replay
- HTML rewriting → URL rewriting: rewrites URLs
pywb/rewrite/html_rewriter.py - HTML rewriting → Content rewriting: delegates rewriting
pywb/rewrite/html_rewriter.py - Timeline model and UI → Archive user: shows captures
- Recording filters → Recorder app: filters requests
pywb/recorder/recorderapp.py - Recorder app → WARC writer: writes records