Throttle YT
This commit is contained in:
parent
4eb87e05d7
commit
7620d1e384
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue