Skip to content

Commit eff05f8

Browse files
committed
v.0.0.3.3 update
v.0.0.3.3 update
1 parent f0770d4 commit eff05f8

3 files changed

Lines changed: 69 additions & 57 deletions

File tree

YouTubeTimeLineGenerator/Form1.Designer.cs

Lines changed: 53 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

YouTubeTimeLineGenerator/Form1.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,19 @@ private void processVTT()
288288
string sWordEnd = "";
289289
int sPosition = 0;
290290

291-
for (int i = 10; i < textBox_vtt.Lines.Count(); i = i + 8)
291+
//Find the position that timeline start.
292+
int ContentStart = 0;
293+
foreach (var text in textBox_vtt.Lines)
294+
{
295+
if (Regex.IsMatch(text, patternTime))
296+
{
297+
break;
298+
}
299+
ContentStart++;
300+
}
301+
302+
//remove redundent spaces and returns.
303+
for (int i = ContentStart; i < textBox_vtt.Lines.Count(); i = i + 8)
292304
{
293305
sContent += textBox_vtt.Lines[i] + "\r\n" + textBox_vtt.Lines[i + 2] + "\r\n";
294306
}

0 commit comments

Comments
 (0)