diff --git a/src/main.rs b/src/main.rs index 8c87d7e..007d936 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,9 +7,9 @@ use lazy_static::lazy_static; use std::sync::atomic::{AtomicU32, Ordering}; use async_std::task; use std::time; -use log::{warn, debug}; +use log::{warn, debug, info}; use std::io::Write; -use reqwest::{Client, redirect::Policy, StatusCode, header}; +use reqwest::{Client, redirect::Policy, StatusCode, header, Url}; use regex::Regex; use scraper::{Html, Selector}; use failure::{Fail, Error, format_err}; @@ -104,6 +104,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(); + static ref AZURE_BUILD_REGEX: Regex = Regex::new(r"https://dev.azure.com/[^/]+/[^/]+/_build").unwrap(); } if status == StatusCode::NOT_FOUND && ACTIONS_REGEX.is_match(&url) { let rewritten = ACTIONS_REGEX.replace_all(&url, "https://github.com/$org/$repo"); @@ -120,6 +121,14 @@ fn get_url(url: String) -> BoxFuture<'static, (String, Result