diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 01:31:21 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 01:31:21 +0100 |
| commit | f811fed0d65bed62bb1c5a986f6f355d3b68612d (patch) | |
| tree | 8e1b9ba652f3ce88c5d569b622bea9344e258621 /src/music.rs | |
| parent | music: decode compressed playback without a temp file (diff) | |
| download | senator-sperma-f811fed0d65bed62bb1c5a986f6f355d3b68612d.tar.gz senator-sperma-f811fed0d65bed62bb1c5a986f6f355d3b68612d.zip | |
music: reject live streams on the yt-dlp path
Diffstat (limited to 'src/music.rs')
| -rw-r--r-- | src/music.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/music.rs b/src/music.rs index acec278..0b907d3 100644 --- a/src/music.rs +++ b/src/music.rs | |||
| @@ -547,6 +547,13 @@ pub(crate) fn sanitize_yt_url(url: &str) -> String { | |||
| 547 | } | 547 | } |
| 548 | 548 | ||
| 549 | async fn build_input(request: &TrackRequest, http: &reqwest::Client) -> Result<Input> { | 549 | async fn build_input(request: &TrackRequest, http: &reqwest::Client) -> Result<Input> { |
| 550 | // yt-dlp would block forever collecting a live stream into memory (and | ||
| 551 | // `--match-filter !is_live` rejects the remaining cases). | ||
| 552 | if request.kind == SourceKind::YtDlp && is_live_stream_hint(&request.url) { | ||
| 553 | return Err(Error::Custom( | ||
| 554 | "live streams are not supported through yt-dlp".into(), | ||
| 555 | )); | ||
| 556 | } | ||
| 550 | if request.compressed { | 557 | if request.compressed { |
| 551 | let audio_bytes = match request.kind { | 558 | let audio_bytes = match request.kind { |
| 552 | SourceKind::YtDlp => { | 559 | SourceKind::YtDlp => { |
