diff --git a/api/src/processing/services/facebook.js b/api/src/processing/services/facebook.js index 7bfd4751e..adab20233 100644 --- a/api/src/processing/services/facebook.js +++ b/api/src/processing/services/facebook.js @@ -29,6 +29,12 @@ export default async function({ id, shareType, shortLink }) { if (shareType) url = `https://web.facebook.com/share/${shareType}/${id}`; if (shortLink) url = await resolveUrl(`https://fb.watch/${shortLink}`); + // Handle URLs with query parameters like ?mibextid + if (url.includes('?')) { + const urlObj = new URL(url); + url = urlObj.origin + urlObj.pathname; + } + const html = await fetch(url, { headers }) .then(r => r.text()) .catch(() => false); @@ -54,4 +60,4 @@ export default async function({ id, shareType, shortLink }) { filename: `${baseFilename}.mp4`, audioFilename: `${baseFilename}_audio`, }; -} +} \ No newline at end of file