filter out distasteful characters. namely apostrophe.

not an illegal character in a file path, which yt-dlp would handle for me, but given how I send it off to ffmpeg I trip over this sometimes
This commit is contained in:
Adam R Grey 2023-04-10 14:43:27 -04:00
parent 036dff3b12
commit 3958eee080
2 changed files with 12 additions and 6 deletions

View File

@ -72,10 +72,6 @@ namespace ttrss_co_client.tasks
{
contentSegments.Add(new Tuple<double, double>(previousEdge, junkSegment.segment[0]));
previousEdge = junkSegment.segment[1];
if(previousEdge < 0.5)
{
contentSegments.Clear();
}
}
contentSegments.Add(new Tuple<double, double>(previousEdge, segments.First().videoDuration));
contentSegments = contentSegments.Except(contentSegments.Where(tup => tup.Item2 - tup.Item1 < 0.5)).ToList();

View File

@ -44,9 +44,19 @@ namespace ttrss_co_client.tasks
}
else
{
var outputFilename = res.Data;
Console.WriteLine($"{headline.title} downloaded.");
var outputFilename = res.Data;
foreach(char c in "'\"")
{
outputFilename = outputFilename.Replace(c, '_');
}
if(outputFilename != res.Data)
{
File.Move(res.Data, outputFilename);
}
var toReturn = new WorkOrder()
{
articleId = headline.id,//<-- that way later tasks can update the note
@ -59,7 +69,7 @@ namespace ttrss_co_client.tasks
{
Console.WriteLine($"{headline.title} needs conversion task.");
toReturn.Phase2TaskList[0] = "convert";
toReturn.data["conversion-target"] = outputFilename.Substring(0, res.Data.LastIndexOf('.')) + ".mp4";
toReturn.data["conversion-target"] = outputFilename.Substring(0, outputFilename.LastIndexOf('.')) + ".mp4";
}
if(headline.link.Host.EndsWith("youtube.com"))