From ade6a200f6496c7d0eabd6b9c7541ec914535070 Mon Sep 17 00:00:00 2001 From: aprzn Date: Wed, 22 Feb 2023 01:11:31 -0500 Subject: [PATCH] it ain't much, but it's honest decoding --- src/gd.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gd.rs b/src/gd.rs index fed47f8..c4bfa68 100644 --- a/src/gd.rs +++ b/src/gd.rs @@ -49,6 +49,14 @@ pub enum SongRequestError { impl InnerLevel { pub fn try_from_encoded_ils(ils: &str) -> Option { + let b64 = URL_SAFE.decode(ils).ok()?; + let mut decoder = GzDecoder::<&[u8]>::new(b64.as_ref()); + let mut ils = String::new(); + decoder.read_to_string(&mut ils).ok()?; + Self::try_from_ils(&ils) + } + + pub fn try_from_ils(ils: &str) -> Option { todo!() } }