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 serde::Deserialize;
use std::env;
#[derive(Deserialize)] #[derive(Deserialize)]
struct Channel { struct Channel {
@@ -21,8 +22,11 @@ async fn main() {
// Err(error) => println!("NOPE"), // 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 { 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);
} }
} }