public async Task DownloadPage(PageItem page, int line) { try { // logic to handle mediatype var html = await GetHtml(page.Url); var config = ExtractPlayerConfig(html); if (config == null || config.LosslessFile == null) { return; } await DownloadFile(config.LosslessFile, line); } catch (Exception ex) { Console.WriteLine("ERROR " + ex.Message + ex.StackTrace); page.Print(); } }