Added
- Audio source auto-routing: New
AudioSourceRouter automatically detects URL protocol:
file:// URLs → LocalSource (bypasses yt-dlp)
- Local paths (
/home/user/audio.mp3, ./audio.mp3) → LocalSource
- YouTube URLs →
YouTubeSource
- Other HTTP URLs →
URLSource
- URL source provider: New
audio_source_provider config option supports url to use URLSource directly.
- Robust YouTube URL detection: Uses proper URL parsing instead of substring matching to avoid false positives (e.g.,
myyoutube.com is not YouTube).
Changed
- Replaced pydub with ffprobe: Duration detection in
LocalSource and URLSource now uses ffprobe directly instead of pydub.
Fixed
- Protocol conformance:
get_metadata() return type now allows None to conform with implementations that don't support metadata extraction.
- URL parameter naming: Fixed parameter name mismatch (
source_url → url) in URLSource.download() to match protocol.
Configuration
# Select audio source provider (default: youtube - auto-routing enabled)
export AUDIORAG_AUDIO_SOURCE_PROVIDER="local" # Force LocalSource
export AUDIORAG_AUDIO_SOURCE_PROVIDER="url" # Force URLSource
export AUDIORAG_AUDIO_SOURCE_PROVIDER="youtube" # YouTube + auto-routing (default)