Commit 9b44c7acbc

9b44c7acbc5cd0084dc2ad1ab2b6a680d01ea667

parent: ca66396c59

Unsigned

siriusmart <siriusmart@tuta.io> · 2025-08-11 15:52 UTC

#88, weird

Layout: unified · split

src/global/functions/from_url.rs +2 −2
@@ -29,13 +29,13 @@ pub fn from_video_url(identifier: &str) -> Result<String, String> {
2929 } else {
3030 // the id can come after "?v=" in an url
3131 let index = if let Some(index) = identifier.find("?v=") {
32 if identifier.len() < index + 15 {
32 if identifier.len() < index + 14 {
3333 return Err(format!("Cannot find video id from string `{identifier}`"));
3434 }
3535 index + 3
3636 // and also "youtu.be/"
3737 } else if let Some(index) = identifier.find("youtu.be/") {
38 if identifier.len() < index + 21 {
38 if identifier.len() < index + 20 {
3939 return Err(format!("Cannot find video id from string `{identifier}`"));
4040 }
4141 index + 9