configurable user agent
This commit is contained in:
parent
c30deeed49
commit
983a57b3d7
@ -11,6 +11,7 @@ namespace ttrss_co_client
|
||||
public string OnDoneCopy { get; set; }
|
||||
public string WorkingDirectory { get; set; } = "./working/";
|
||||
public string ChatScript { get; set; }
|
||||
public string UserAgent { get; set; }
|
||||
public IEnumerable<FeedAction> feedActions { get; set; }
|
||||
public class FeedAction
|
||||
{
|
||||
|
@ -6,6 +6,7 @@
|
||||
"onDoneCopy":"./",
|
||||
"workingDirectory":"working/",
|
||||
"chatScript": "miscChat.sh",
|
||||
"userAgent": "Mozilla/5.0 (compatible; wget-is-not-a-crime/1.0)",
|
||||
"feedActions":
|
||||
[
|
||||
{
|
||||
|
@ -25,7 +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)");
|
||||
downloader.DefaultRequestHeaders.UserAgent.ParseAdd(Conf.UserAgent);
|
||||
sw.Start();
|
||||
var dlResult = (await downloader.GetAsync(attachmentLink));
|
||||
File.WriteAllBytes(downloadPath, await dlResult.Content.ReadAsByteArrayAsync());
|
||||
|
Loading…
Reference in New Issue
Block a user