apikey :)

This commit is contained in:
2025-07-10 10:33:38 +02:00
parent 0e91b767bd
commit 320b10037c

View File

@@ -1,4 +1,5 @@
use serde::Deserialize;
use std::env;
#[derive(Deserialize)]
struct Channel {
@@ -20,9 +21,12 @@ async fn main() {
// Ok(text) => text,
// Err(error) => println!("NOPE"),
// }; //
let channels =serde_json::from_str::<Vec<Channel>>(&resp).unwrap();
let channels = serde_json::from_str::<Vec<Channel>>(&resp).unwrap();
let APIKEY = env::var("APIKEY").unwrap();
for i in channels {
println!{"{:#?}", i.name};
let ID = i.id;
let videosRequest = format!("https://www.googleapis.com/youtube/v3/channels?id={ID}&key={APIKEY}&part=contentDetails");
println!("{}", videosRequest);
}
}