Compare commits

...

2 Commits

Author SHA1 Message Date
c30deeed49 workaround to be allowed to download podcasts automatically
you know, like a... like a um.. what do you call those...

podcast
2023-11-12 15:09:15 -05:00
2b0586b0ac tell me the title 2023-11-12 15:00:01 -05:00
2 changed files with 6 additions and 2 deletions

View File

@ -15,7 +15,10 @@ public class ChatMessage : Phase2Task
public override async Task<Tuple<TaskStatus, WorkOrder>> ActOn(WorkOrder workOrder)
{
await Process.Start(ChatScript,
workOrder.data["chatmessage"] + (await TtrssClient.GetArticles(workOrder.articleId)).First().feed_title
workOrder.data["chatmessage"] +
(await TtrssClient.GetArticles(workOrder.articleId)).First().feed_title +
"; " +
(await TtrssClient.GetArticles(workOrder.articleId)).First().title
).WaitForExitAsync();
return new Tuple<TaskStatus, WorkOrder>(TaskStatus.Done, workOrder);
}

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());