riva 0.1.0

Provider-agnostic Rust library for extracting normalized media stream metadata from SoundCloud and YouTube via async helpers.
Documentation
#[derive(Debug, thiserror::Error)]
pub enum SignatureError {
    #[error("signature deciphering is not yet implemented")]
    Unavailable,
}

#[derive(Debug, Default)]
pub struct SignatureDecipher;

impl SignatureDecipher {
    pub fn decipher(
        &self,
        _player_js_url: &str,
        _scrambled: &str,
    ) -> Result<String, SignatureError> {
        Err(SignatureError::Unavailable)
    }
}

pub struct SignatureResolver<'a> {
    pub js_url: &'a str,
    pub decipher: &'a SignatureDecipher,
}

impl<'a> SignatureResolver<'a> {
    pub fn apply(&self, scrambled: &str) -> Result<String, SignatureError> {
        self.decipher.decipher(self.js_url, scrambled)
    }
}