diff --git a/ocaml/main.ml b/ocaml/main.ml index 1317303..a04c3ca 100644 --- a/ocaml/main.ml +++ b/ocaml/main.ml @@ -14,12 +14,13 @@ Http_client.Convenience.configure_pipeline (* Regexp required here *) let is_youtube_url url = - let regexp = Str.regexp "https://www.youtube.com/.+" in + let regexp = Str.regexp "\\(https?\\://\\)?\\(www\\.\\)?\\(youtube\\.com\\)\\|\\(youtu\\.be\\)/.+" in Str.string_match regexp url 0 let get_body url = try Http_client.Convenience.http_get url with + | Http_client.Http_error e -> "http error /o\\" | Failure f -> "http fail lol"