From 4d048eba27449a24037fd2532e1d833254a16f6d Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Thu, 30 Jan 2020 15:23:42 +0000 Subject: [PATCH] Add workaround for Youtube 302s (fixes #814) --- src/main.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0e2995c..8c87d7e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -103,6 +103,7 @@ fn get_url(url: String) -> BoxFuture<'static, (String, Result[^/]+)/(?P[^/]+)/actions(?:\?workflow=.+)?").unwrap(); + static ref YOUTUBE_REGEX: Regex = Regex::new(r"https://www.youtube.com/watch\?v=(?P.+)").unwrap(); } if status == StatusCode::NOT_FOUND && ACTIONS_REGEX.is_match(&url) { let rewritten = ACTIONS_REGEX.replace_all(&url, "https://github.com/$org/$repo"); @@ -110,6 +111,15 @@ fn get_url(url: String) -> BoxFuture<'static, (String, Result