workaround to be allowed to download podcasts automatically

you know, like a... like a um.. what do you call those...

podcast
This commit is contained in:
Adam R Grey 2023-11-12 15:09:15 -05:00
parent 2b0586b0ac
commit c30deeed49

View File

@ -25,6 +25,7 @@ namespace ttrss_co_client.tasks
var extensionUpstream = attachmentLink.Substring(attachmentLink.LastIndexOf('.'));
var downloadPath = Path.Combine(workingFolder, headline.title) + extensionUpstream;
var downloader = new HttpClient();
downloader.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");
sw.Start();
var dlResult = (await downloader.GetAsync(attachmentLink));
File.WriteAllBytes(downloadPath, await dlResult.Content.ReadAsByteArrayAsync());