apikey :)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
use std::env;
|
||||||
|
|
||||||
#[derive(Deserialize)]
|
#[derive(Deserialize)]
|
||||||
struct Channel {
|
struct Channel {
|
||||||
@@ -20,9 +21,12 @@ async fn main() {
|
|||||||
// Ok(text) => text,
|
// Ok(text) => text,
|
||||||
// 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user