parent
dbc15fefbb
commit
947c149b40
14
Program.cs
14
Program.cs
|
@ -12,6 +12,18 @@ HttpClient http=new HttpClient();
|
||||||
YoutubeClient ytc=new YoutubeClient(http);
|
YoutubeClient ytc=new YoutubeClient(http);
|
||||||
ConcurrentStack<VideoId> videoIds=new ConcurrentStack<VideoId>();
|
ConcurrentStack<VideoId> videoIds=new ConcurrentStack<VideoId>();
|
||||||
bool isRunning=true;
|
bool isRunning=true;
|
||||||
|
long videosDownloaded=0;
|
||||||
|
|
||||||
|
async Task NewVideoDL()
|
||||||
|
{
|
||||||
|
long dl;
|
||||||
|
lock(videosDownloaded)
|
||||||
|
{
|
||||||
|
dl = videosDownloaded++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((dl % 6) == 5) await Task.Delay(60000);
|
||||||
|
}
|
||||||
|
|
||||||
async Task AddVideo(VideoId id)
|
async Task AddVideo(VideoId id)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +65,7 @@ async Task AddVideo(VideoId id)
|
||||||
}
|
}
|
||||||
client.Disconnect();
|
client.Disconnect();
|
||||||
|
|
||||||
await Task.Delay(15000);
|
await NewVideoDL();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue