fedimbed: try diff way of extracting post id from url

This commit is contained in:
Cynthia Foxwell 2022-12-31 13:02:51 -07:00
parent 5851a5a51d
commit c9b248e23d
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,8 @@ async function processUrl(msg, url) {
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
const noteId = url.match(/^\/notes\/([a-z0-9]+)\/?/)?.[1];
let noteId = url.split("/notes/")[0]
noteId = noteId.split(noteId.indexOf("/") > -1 ? "/" : "?")[0];
redirUrl = urlObj.origin + "/api/notes/show/";
options.method = "POST";
options.body = JSON.stringify({noteId});