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:
parent
2b0586b0ac
commit
c30deeed49
@ -25,6 +25,7 @@ namespace ttrss_co_client.tasks
|
|||||||
var extensionUpstream = attachmentLink.Substring(attachmentLink.LastIndexOf('.'));
|
var extensionUpstream = attachmentLink.Substring(attachmentLink.LastIndexOf('.'));
|
||||||
var downloadPath = Path.Combine(workingFolder, headline.title) + extensionUpstream;
|
var downloadPath = Path.Combine(workingFolder, headline.title) + extensionUpstream;
|
||||||
var downloader = new HttpClient();
|
var downloader = new HttpClient();
|
||||||
|
downloader.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (compatible; AcmeInc/1.0)");
|
||||||
sw.Start();
|
sw.Start();
|
||||||
var dlResult = (await downloader.GetAsync(attachmentLink));
|
var dlResult = (await downloader.GetAsync(attachmentLink));
|
||||||
File.WriteAllBytes(downloadPath, await dlResult.Content.ReadAsByteArrayAsync());
|
File.WriteAllBytes(downloadPath, await dlResult.Content.ReadAsByteArrayAsync());
|
||||||
|
Loading…
Reference in New Issue
Block a user