Bugfixes
This commit is contained in:
parent
5efabcdc62
commit
2ecaa54e18
@ -44,16 +44,16 @@ export function parse_youtube(content: string): Timestamp[] {
|
||||
content
|
||||
.split("\n")
|
||||
.filter((l) => l.length > 4)
|
||||
.map((l) => l.match(/([0-9]{1,}:[0-9]{2})\s(.*)/))
|
||||
.map((l) => l.match(/(([0-9]:)?[0-9]{1,2}:[0-9]{2})\s(.*)/))
|
||||
);
|
||||
return (
|
||||
content
|
||||
.split("\n")
|
||||
.filter((l) => l.length > 4)
|
||||
.map((l) => l.match(/([0-9]{1,}:[0-9]{2})\s(.*)/))
|
||||
.map((l) => l.match(/(([0-9]:)?[0-9]{1,2}:[0-9]{2})\s(.*)/))
|
||||
.filter((m) => m != null) as string[][]
|
||||
).map(([_, time_s, title]) => ({
|
||||
title,
|
||||
).map(([_, time_s, __, title]) => ({
|
||||
title: title.replace(/^\s*[-:]\s+/, ""),
|
||||
timestamp: parseTimestamp(time_s),
|
||||
}));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user