fedimbed: ple
This commit is contained in:
parent
8477a3bf87
commit
fc809c41f0
1 changed files with 4 additions and 4 deletions
|
@ -840,16 +840,16 @@ async function fetchPost(url, platform, forceMastoAPI = false) {
|
||||||
let redirUrl;
|
let redirUrl;
|
||||||
const options = {};
|
const options = {};
|
||||||
const headers = {};
|
const headers = {};
|
||||||
if (PATH_REGEX.pleroma2.test(urlObj.pathname)) {
|
if (urlObj.hostname === "truthsocial.com") {
|
||||||
|
const postId = urlObj.pathname.match(PATH_REGEX.truthsocial)?.[2];
|
||||||
|
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
||||||
|
} else if (PATH_REGEX.pleroma2.test(urlObj.pathname)) {
|
||||||
redirUrl = url.replace("notice", "api/v1/statuses");
|
redirUrl = url.replace("notice", "api/v1/statuses");
|
||||||
} else if (PATH_REGEX.mastodon.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.mastodon.test(urlObj.pathname)) {
|
||||||
const postId = urlObj.pathname.match(PATH_REGEX.mastodon)?.[2];
|
const postId = urlObj.pathname.match(PATH_REGEX.mastodon)?.[2];
|
||||||
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
||||||
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.mastodon2.test(urlObj.pathname)) {
|
||||||
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
|
redirUrl = url.replace(/^\/(.+?)\/statuses/, "/api/v1/statuses");
|
||||||
} else if (urlObj.hostname === "truthsocial.com") {
|
|
||||||
const postId = urlObj.pathname.match(PATH_REGEX.truthsocial)?.[2];
|
|
||||||
redirUrl = urlObj.origin + "/api/v1/statuses/" + postId;
|
|
||||||
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
|
} else if (PATH_REGEX.misskey.test(urlObj.pathname)) {
|
||||||
let noteId = url.split("/notes/")[1];
|
let noteId = url.split("/notes/")[1];
|
||||||
if (noteId.indexOf("/") > -1) {
|
if (noteId.indexOf("/") > -1) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue