Throttle YT
This commit is contained in:
parent
4eb87e05d7
commit
7620d1e384
|
@ -12,15 +12,17 @@ HttpClient http=new HttpClient();
|
||||||
YoutubeClient ytc=new YoutubeClient(http);
|
YoutubeClient ytc=new YoutubeClient(http);
|
||||||
ConcurrentStack<string> ids=new ConcurrentStack<string>();
|
ConcurrentStack<string> ids=new ConcurrentStack<string>();
|
||||||
bool isRunning=true;
|
bool isRunning=true;
|
||||||
Box<long> videosDownloaded=0;
|
Box<ulong> videosDownloaded=0;
|
||||||
|
|
||||||
async Task NewVideoDL()
|
async Task NewVideoDL()
|
||||||
{
|
{
|
||||||
long dl;
|
ulong dl;
|
||||||
lock(videosDownloaded)
|
lock(videosDownloaded)
|
||||||
{
|
{
|
||||||
|
unchecked {
|
||||||
dl = videosDownloaded.Item++;
|
dl = videosDownloaded.Item++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if((dl % 4) == 3) await Task.Delay(45000);
|
if((dl % 4) == 3) await Task.Delay(45000);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue