v1.2.0
Added
Custom filename support in DownloadOptions
Implements feature request #4
- New Filename field - Optional custom output filename (without extension)
- Resolves filename conflicts - Avoids collisions from reused video titles
- Precedence over title - Custom filename takes priority when provided
- Automatic sanitization - Invalid characters removed from filenames
- Use case: ragpile - Allows unique naming using video IDs (e.g., 'dQw4w9WgXcQ')
Usage Example
// Download with custom filename using video ID
result, err := ytsync.DownloadVideoWithOptions(ctx, "dQw4w9WgXcQ", &ytsync.DownloadOptions{
OutputDir: "/tmp/downloads",
Filename: "dQw4w9WgXcQ", // Use video ID for unique naming
})Testing
- Added 7 comprehensive unit tests
- Coverage for custom filenames with special characters
- Tests for video ID usage and edge cases
- All existing tests pass
Binaries
Pre-built binaries available for:
- Linux (amd64, arm64)
- macOS (amd64, arm64)
- Windows (amd64)
SHA256 checksums in SHA256SUMS file.