public AddMoviesToTheQueue() { this._movieContextDownloadQueue = new MovieContext(); this._movieContextUpdate = new MovieContext(); this._aria2Client = new Aria2Client(Config.Aria2Url, Config.Aria2Port); }
static async Task Main(string[] args) { RunAria2(); _client = new Aria2Client("localhost", _aria2Port); var gid = await Demo.UriDownload(_client); await Task.Delay(3000); //wait 3 sec var downloadStatus = await Demo.GetStatus(_client, gid); Console.WriteLine($@" Dir:{downloadStatus.Dir} Speed:{downloadStatus.DownloadSpeed} Length:{downloadStatus.TotalLength} "); await Task.Delay(1000); downloadStatus = await Demo.GetStatus(_client, gid); Console.WriteLine($@" Dir:{downloadStatus.Dir} Speed:{downloadStatus.DownloadSpeed} Length:{downloadStatus.TotalLength} "); Console.ReadKey(); _client.Shutdown(); }
public DownloadProgress(ILogger <DownloadProgress> logger, IHubContext <DownloadProgressHub> downloadProgressHub) { _logger = logger; this._aria2Client = new Aria2Client(Config.Aria2Url, Config.Aria2Port); _logger.LogInformation("ARIA2 " + this._aria2Client); _downloadProgressHub = downloadProgressHub; this._movieContext = new MovieContext(); this._movieContextReadOnly = new MovieContext(); }
public HomeController( ILogger<HomeController> logger, IHubContext<DownloadProgressHub> downloadProgressHub, MovieContext _movieContext, ILogger<DownloadProgress> loggerDownloadProcessor ) { _logger = logger; this._aria2Client = new Aria2Client("http://127.0.0.1", 6800); _logger.LogInformation("amohammed " + this._aria2Client); _downloadProgressHub = downloadProgressHub; this._movieContext = _movieContext; this.LoggerDownloadProcessor = loggerDownloadProcessor; this._movieContextReadOnly = new MovieContext(); }
public static async Task <string> UriDownload(Aria2Client client) { return(await client.AddUri("https://speed.hetzner.de/1GB.bin")); }
public static async Task <DownloadStatusModel> GetStatus(Aria2Client client, string gid) { return(await client.TellStatus(gid)); }
public static void Shutdown(Aria2Client aria2) { aria2?.Shutdown(); }