This commit is contained in:
2025-07-08 10:32:11 +02:00
parent 4417e2b20c
commit c343f8659c
2 changed files with 11 additions and 5 deletions

View File

@@ -4,17 +4,19 @@ use std::collections::HashMap;
struct Channel { struct Channel {
id: String, id: String,
name: String, name: String,
type: String kind: String
} }
#[tokio::main] #[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> { async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channellist = "https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.yaml";
//getting the list of channels with id's first //getting the list of channels with id's first
//
//https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.json //https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.json
let resp = reqwest::get("https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.json") let resp = reqwest::get(channellist)
.await? .await?
.json::<HashMap<String, String>>() .text()
.await?; .await?;
println!("{resp:#?}"); let channels: Vec<Channel> =serde_yaml_ng::from_str(&resp)?;
Ok(())
} }

4
static/yters.yaml Normal file
View File

@@ -0,0 +1,4 @@
channels:
- name: "squibquib"
id: "UC-9-sjOyxoDCdQlVzObzGsw"
kind: "letsplay"