about summary refs log tree commit diff stats
path: root/crates/yt_dlp/src/post_processors/mod.rs
blob: 6067c7a5c281aa5b7f68423d2a8549ec3a9d600c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use crate::InfoJson;

pub mod dearrow;

pub trait PostProcessor: std::fmt::Debug + Send {
    /// Process a [`InfoJson`] object and return the updated one.
    ///
    /// # Errors
    /// If the processing steps failed.
    fn process(&self, info: InfoJson) -> Result<InfoJson, Error>;

    /// The supported extractors for this post processor
    fn extractors(&self) -> &'static [&'static str];
}

#[derive(thiserror::Error, Debug)]
pub enum Error {
    #[error("Failed to access a api: {0}")]
    Get(#[from] reqwest::Error),
}