feat: add relevant debug bits

This commit is contained in:
VC
2023-10-16 21:23:29 +02:00
parent ae3fa74d9b
commit 3f482ff258
2 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
use crate::{config::YoutubeConfig, error::TootubeError, peertube::PeerTubeVideo};
use bytes::Bytes;
use futures_core::stream::Stream;
use log::debug;
use reqwest::{multipart::Form, Body, Client};
use serde::{Deserialize, Serialize};
use std::{error::Error, io::stdin};
@@ -207,6 +208,7 @@ async fn refresh_token(config: &YoutubeConfig) -> Result<String, reqwest::Error>
let access_token: AccessTokenResponse = res.json().await?;
debug!("YT Access Token: {}", &access_token.access_token);
Ok(access_token.access_token)
})
.await
@@ -250,6 +252,7 @@ async fn get_playlist_ids(
}
}
debug!("Playlists IDs: {:?}", &playlists);
Ok(playlists)
}
@@ -273,8 +276,8 @@ pub async fn add_video_to_playlists(
..Default::default()
},
};
let client = Client::new();
let client = Client::new();
let res = client
.post("https://youtube.googleapis.com/youtube/v3/playlistItems?part=snippet")
.header("Authorization", format!("Bearer {}", access_token))
@@ -316,6 +319,7 @@ pub async fn create_resumable_upload(
}
},
};
debug!("YT upload params: {:?}", &upload_params);
let client = Client::new();
let res = client.post("https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet%2Cstatus")
@@ -349,7 +353,6 @@ pub async fn now_kiss<'a>(
// Create client
let client = Client::new();
let res = client
.put(r_url)
.header("Authorization", format!("Bearer {}", access_token))