From d370eeecfb0271aa8f1721e3936ac66ab159389d Mon Sep 17 00:00:00 2001 From: 0x24d Date: Thu, 14 Mar 2024 20:08:46 +0000 Subject: [PATCH] Rename mislabelled audio segments to .aac --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2890168..d32fc83 100644 --- a/src/main.rs +++ b/src/main.rs @@ -291,7 +291,7 @@ async fn index(req: HttpRequest) -> Result> { QString::new(collected) }; - let mut url = Url::parse(&format!("https://{}{}", host, req.path()))?; + let mut url = Url::parse(&format!("https://{}{}", host, req.path().replace("seg.aac", "seg.ts")))?; url.set_query(Some(qs.to_string().as_str())); let method = { @@ -435,6 +435,8 @@ async fn index(req: HttpRequest) -> Result> { utils::localize_url(url, host.as_str()).as_str(), ); } + } else if line.contains("/itag/233") || line.contains("/itag/234") { + return utils::localize_url(line.replace("seg.ts", "seg.aac").as_str(), host.as_str()); } utils::localize_url(line, host.as_str()) })