fix formatting

This commit is contained in:
Oleg Sobolev 2024-03-25 17:14:33 +07:00
parent 91eca478c4
commit 22659046be
3 changed files with 18 additions and 15 deletions

View file

@ -1,6 +1,7 @@
use crate::track::TrackInfo;
use std::{path::Path, process::Command};
use crate::track::TrackInfo;
#[derive(Debug, Clone, Copy)]
pub struct DownloadError;
@ -14,12 +15,13 @@ pub fn download_from_youtube(url: &str) -> Result<TrackInfo, DownloadError> {
"mp3",
"--print",
"%(id)s",
"--no-simulate",
url,
])
.output()
.unwrap();
if !output.stderr.is_empty() {
if !output.stderr.is_empty() || output.stdout.is_empty() {
return Err(DownloadError);
}