feat: copy selected video URL

This commit is contained in:
2026-10-22 15:38:59 +02:00
parent 01275e20b8
commit b12bba9125
9 changed files with 80 additions and 14 deletions
+24
View File
@@ -532,6 +532,30 @@ mod subprocesses {
assert_reaped(pid);
}
}
#[test]
fn video_urls_preserve_provider_identity_and_reject_invalid_keys() {
assert_eq!(
video_url("jNQXAC9IVRw").unwrap(),
"https://www.youtube.com/watch?v=jNQXAC9IVRw"
);
assert_eq!(
video_url("miruro:opaque_ID-7:3").unwrap(),
"https://barelystarted.miruro.tv/watch/opaque_ID-7/episode?ep=3"
);
for id in [
"",
"--help",
"jNQXAC9IVRw&list=other",
"miruro:id:0",
"miruro:id:03",
"miruro:../id:3",
] {
assert_eq!(
video_url(id).unwrap_err().kind(),
io::ErrorKind::InvalidInput
);
}
}
#[test]
fn browser_open_rejects_unsafe_video_ids_before_spawning() {