fix: validate stream_url and clear stale session on error
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -60,6 +60,10 @@ pub fn resolve(url: &str, cookie_source: &CookieSource) -> Result<VideoMetadata,
|
||||
.trim()
|
||||
.to_string();
|
||||
|
||||
if stream_url.is_empty() {
|
||||
return Err("yt-dlp returned an empty stream URL".to_string());
|
||||
}
|
||||
|
||||
Ok(VideoMetadata {
|
||||
url: url.to_string(),
|
||||
title: meta.title,
|
||||
|
||||
Reference in New Issue
Block a user