mirror of
https://codeberg.org/YGGverse/ytd.git
synced 2026-04-09 05:15:30 +00:00
implement custom invidious instance support
This commit is contained in:
parent
6afac2f85f
commit
22e3c301a2
4 changed files with 12 additions and 6 deletions
|
|
@ -19,8 +19,12 @@ impl Provider {
|
|||
pub fn youtube() -> Self {
|
||||
Self::Youtube(RustyPipe::new())
|
||||
}
|
||||
pub fn invidious() -> Self {
|
||||
Self::Invidious(ClientSync::default())
|
||||
pub fn invidious(instance: Option<String>) -> Self {
|
||||
let mut client = ClientSync::default();
|
||||
if let Some(i) = instance {
|
||||
client.set_instance(i)
|
||||
}
|
||||
Self::Invidious(client)
|
||||
}
|
||||
pub async fn videos(&self, channel_id: &str) -> Result<Vec<Video>> {
|
||||
let mut videos = Vec::new();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue