增加弹幕库解析的兼容

This commit is contained in:
Harvey Zack committed 2022-06-12 20:17:20 +08:00
1 parent 1a638c490a
commit 7cbf28e134
7 files changed
+22 -22

No files matched your search

@@ -18,7 +18,7 @@ export function bilibiliDanmuParseFromXml(xmlString) {
return Array.from(matches)
.map((match) => {
const attr = match.groups.p.split(',');
if (attr.length === 8) {
if (attr.length >= 8) {
const text = match.groups.text
.trim()
.replaceAll('"', '"')
@@ -42,7 +42,7 @@ export function bilibiliDanmuParseFromXml(xmlString) {
return null;
}
})
.filter((d) => d);
.filter(Boolean);
}
export function bilibiliDanmuParseFromUrl(url) {