Throttle YT

This commit is contained in:
Mike Nolan 2025-02-12 09:17:45 -06:00
parent 4eb87e05d7
commit 7620d1e384
1 changed files with 4 additions and 2 deletions

View File

@ -12,14 +12,16 @@ HttpClient http=new HttpClient();
YoutubeClient ytc=new YoutubeClient(http);
ConcurrentStack<string> ids=new ConcurrentStack<string>();
bool isRunning=true;
Box<long> videosDownloaded=0;
Box<ulong> videosDownloaded=0;
async Task NewVideoDL()
{
long dl;
ulong dl;
lock(videosDownloaded)
{
unchecked {
dl = videosDownloaded.Item++;
}
}
if((dl % 4) == 3) await Task.Delay(45000);