Implemented the CLI entry point using Click framework. The CLI:
- Accepts Space URL as an argument
- Supports --cookies and --output options
- Validates URLs using the validator module
- Downloads Spaces using the downloader module
- Provides clear success and error messages
- Uses proper exit codes (0=success, 1=validation error, 2=download error)
Test uses Click's CliRunner to test CLI without running actual downloads.
Mocks validate_space_url and download_space functions for isolated testing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added DownloadError exception class that is raised when yt-dlp fails.
The download_space function now wraps yt-dlp calls in a try-except block
to catch any exceptions and raise a custom DownloadError with a clear message.
Test added to verify that DownloadError is raised when yt-dlp fails.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add test for cookies_file parameter verification
- Add test for yt-dlp configuration (format, outtmpl, postprocessors)
- Use validator module for robust space_id extraction
- Replace fragile URL splitting with validate_space_url()
- Handles trailing slashes and query parameters correctly
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added comprehensive test coverage for URL validation:
- Test for invalid URL formats (missing /i/, missing space ID, malformed URLs)
- Test for twitter.com domain support (in addition to x.com)
Updated validator implementation:
- Extended regex pattern to accept both x.com and twitter.com domains
- Updated group capture index to account for domain alternation
All validator tests passing (3/3).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>