|
|
@ -16,7 +16,8 @@ struct Video { |
|
|
|
fn new(video: Form<Video>) -> Redirect { |
|
|
|
fn new(video: Form<Video>) -> Redirect { |
|
|
|
if video.link.starts_with("https://"){ |
|
|
|
if video.link.starts_with("https://"){ |
|
|
|
Command::new("/bin/env") |
|
|
|
Command::new("/bin/env") |
|
|
|
.args(&["DISPLAY:=0", "bash", "-c", &format!("mpv {link}", link=&video.link).to_string()]) |
|
|
|
// .args(&[&video.link])
|
|
|
|
|
|
|
|
.args(&["DISPLAY=:0", "bash", "-c", &format!("mpv {link}", link=&video.link).to_string()]) |
|
|
|
.output() |
|
|
|
.output() |
|
|
|
.expect("Failed to execute command"); |
|
|
|
.expect("Failed to execute command"); |
|
|
|
} |
|
|
|
} |
|
|
|