diff --git a/src/main.rs b/src/main.rs index 3f35786..c321757 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,9 @@ async fn main() -> Result<(), Box> { // Upload videos println!("\nUploading videos..."); for (i, (video_file, video_metadata)) in video_files.iter().zip(metadata.iter()).enumerate() { + if (i+1) % 10 == 0 { + uploader.authenticate().await?; + } println!("Uploading {} ({}/{})", video_file, i + 1, video_files.len()); match uploader.upload_video(video_file, video_metadata).await { diff --git a/src/youtube.rs b/src/youtube.rs index 1908783..dfbec0d 100644 --- a/src/youtube.rs +++ b/src/youtube.rs @@ -177,7 +177,7 @@ impl YouTubeUploader { .ok_or("No access token in response")? .to_string(); - let expires_in = token_data["expires_in"].as_u64().unwrap_or(10800); + let expires_in = token_data["expires_in"].as_u64().unwrap_or(3600); let expires_at = Some(Utc::now() + Duration::seconds(expires_in as i64)); Ok(StoredTokens {