mirror of
https://github.com/wukko/cobalt.git
synced 2025-02-13 14:16:25 +01:00
api/url: extract loom video id from longer links (#832)
Co-authored-by: jj <log@riseup.net>
This commit is contained in:
parent
20b1d9ab30
commit
d6b0fbc8ec
1 changed files with 8 additions and 0 deletions
|
@ -98,6 +98,14 @@ function aliasURL(url) {
|
|||
if (url.hostname === 'xhslink.com' && parts.length === 3) {
|
||||
url = new URL(`https://www.xiaohongshu.com/a/${parts[2]}`);
|
||||
}
|
||||
break;
|
||||
|
||||
case "loom":
|
||||
const idPart = parts[parts.length - 1];
|
||||
if (idPart.length > 32) {
|
||||
url.pathname = `/share/${idPart.slice(-32)}`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return url;
|
||||
|
|
Loading…
Reference in a new issue