oops, better like this

This commit is contained in:
2025-07-13 12:34:52 +02:00
parent e2b765d703
commit e10c3bcff2
4 changed files with 23 additions and 3 deletions

View File

@@ -1,5 +1,7 @@
use serde::Deserialize;
use std::env;
use chrono;
use dotenv::dotenv;
#[derive(Deserialize)]
struct Channel {
@@ -8,17 +10,26 @@ struct Channel {
kind: String,
}
struct Videos {
id: String,
name: String,
}
#[tokio::main]
async fn main() {
dotenv.ok();
let channellist = "https://raw.githubusercontent.com/bvanroll/home/refs/heads/master/static/yters.json";
let resp = reqwest::get(channellist)//.await.unwrap().text().await;
.await.unwrap()
.text().await.unwrap();
let channels = serde_json::from_str::<Vec<Channel>>(&resp).unwrap();
let apikey = env::var("APIKEY").unwrap();
// let lastMonday =
for i in channels {
let id = i.id;
let videos_request = format!("https://www.googleapis.com/youtube/v3/channels?id={id}&key={apikey}&part=contentDetails");
let videos_request = format!("https://www.googleapis.com/youtube/v3/search/?channelId={id}&part=snippet,id&order=date&publishedAfter={date}&key={apikey}");
//let videos_request = format!("https://www.googleapis.com/youtube/v3/channels?id={id}&key={apikey}&part=contentDetails");
println!("{}", videos_request);
}