update name regex torrent9

This commit is contained in:
TheBeastLT
2021-09-20 11:07:53 +02:00
parent e01b3e87a3
commit 897988dafe

View File

@@ -118,7 +118,8 @@ function getName(details) {
return nameElement.contents().filter((_, elem) => elem.type === 'text').text()
}
const description = nameElement.parent().text();
const nameMatch = description.match(/(?:[A-Z]+|[0-9]+)[^A-Z ]*\.([\w-]+\.){3,}\w+(?:-\w+)?(?=[A-Z])/);
const nameMatch = description.match(
/(?:[A-Z]+[^A-Z0-9]*|[A-Z0-9-]+(?:[a-z]+\d+)?)\.([\w-]+\.){3,}\w+(?:-\w+)?(?=[A-Z])/);
return nameMatch && nameMatch[0];
}