Fix RisuRealm UUID identifier import

This commit is contained in:
Cohee 2024-05-20 12:51:10 +03:00
parent 863e0c3643
commit ed2e7a2f47

View File

@ -516,7 +516,8 @@ async function downloadGenericPng(url) {
*/
function parseRisuUrl(url) {
// Example: https://realm.risuai.net/character/7adb0ed8d81855c820b3506980fb40f054ceef010ff0c4bab73730c0ebe92279
const pattern = /^https?:\/\/realm\.risuai\.net\/character\/([a-f0-9]{64})$/;
// or https://realm.risuai.net/character/7adb0ed8-d818-55c8-20b3-506980fb40f0
const pattern = /^https?:\/\/realm\.risuai\.net\/character\/([a-f0-9-]+)\/?$/i;
const match = url.match(pattern);
return match ? match[1] : null;
}