up
This commit is contained in:
+14
-1
@@ -613,7 +613,20 @@ if (empty($user_id)) {
|
||||
} else if (isValidMediaUrl(msg.local_file)) {
|
||||
thumbUrl = `/${msg.local_file}`;
|
||||
} else if (isValidMediaUrl(msg.media_url_external)) {
|
||||
thumbUrl = msg.media_url_external;
|
||||
// Si es una URL externa de Facebook/lookaside, usar el proxy para incluir Authorization
|
||||
const external = msg.media_url_external;
|
||||
if (/lookaside\.fbsbx\.com|graph\.facebook\.com|facebook\.com/i.test(external)) {
|
||||
// Intentar extraer mid del query string para usar ?id=
|
||||
const midMatch = external.match(/[?&]mid=([^&]+)/i);
|
||||
if (midMatch && midMatch[1]) {
|
||||
const mid = decodeURIComponent(midMatch[1]);
|
||||
thumbUrl = `/api/version/media-url.php?id=${encodeURIComponent(mid)}`;
|
||||
} else {
|
||||
thumbUrl = `/api/version/media-url.php?url=${encodeURIComponent(external)}`;
|
||||
}
|
||||
} else {
|
||||
thumbUrl = external;
|
||||
}
|
||||
} else if (isValidMediaUrl(msg.media_url)) {
|
||||
thumbUrl = msg.media_url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user