ok
This commit is contained in:
@@ -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
4
static/yters.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
channels:
|
||||||
|
- name: "squibquib"
|
||||||
|
id: "UC-9-sjOyxoDCdQlVzObzGsw"
|
||||||
|
kind: "letsplay"
|
Reference in New Issue
Block a user