From cc4f530764fac2220afa8894370ebe23dedf3fe5 Mon Sep 17 00:00:00 2001 From: Zastian Pretorius Date: Sat, 7 Jan 2023 22:25:54 +0000 Subject: [PATCH] fixed my shit regex --- src/anime/scraper.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anime/scraper.rs b/src/anime/scraper.rs index f5b4acb..8f87653 100644 --- a/src/anime/scraper.rs +++ b/src/anime/scraper.rs @@ -66,10 +66,10 @@ pub fn get_anime_link(url: &str, episode: u64) -> String { episode ); let html = get_anime_html(url); - let re = Regex::new(r#"iframe id="main-embed" src="https://yugen.to/e/(.*)=="#).unwrap(); + let re = Regex::new(r#"iframe id="main-embed" src="https://yugen\.to/e/([^/]*)/"#).unwrap(); let capture = re.captures(&html).unwrap(); let id = &capture[1]; - let id = format!("id={}%3D%3D&ac=0", id); + let id = format!("id={}%3D&ac=0", id); let json = get_post(&id); let re = Regex::new(r#"hls": \["(.*)","#).unwrap(); let capture = re.captures(&json).unwrap();