xfa (similar to fixupx.com or fxtwitter.com) is a self-hostable Node.js web server that intercepts requests for Facebook posts, videos, reels, and photos, and returns a Discord-optimized HTML page with rich OpenGraph and oEmbed metadata.
When a user posts a Facebook link in Discord (e.g., https://xfa-facebook.com/share/r/18EhyfvqST/), Discord's crawler requests the page. xfa scrapes the post details, retrieves direct video streams (.mp4 CDN URLs) and high-quality preview images, and formats them so Discord can embed the video and image directly in the chat window.
- Direct Video Embeds: Scrapes direct Facebook CDN
.mp4URLs to play reels and videos inline on Discord. - Rich Media Previews: Extracts high-quality post images, descriptions, and authors.
- Smart User-Agent Routing:
- Discord/Telegram/Slack/etc. Bots: Served with customized HTML containing OpenGraph metadata and oEmbed tags.
- Normal Users (Browsers): Redirected instantly (via HTTP 302 and Javascript backup) to the original Facebook link.
- oEmbed Integration: Custom endpoint to display the original publisher/author's name and profile link at the top of the Discord embed.
- Robust Scraper Fallbacks:
- Direct Browser emulation (Highest quality, yields direct video CDN links).
- Direct Bot fallback (Extracts standard meta tags).
- Iframe Plugin parsing (Resilient fallback utilizing Facebook's official widgets).
- Node.js (v16 or higher)
- npm or pnpm
- Clone or copy this repository to your hosting environment.
- Install the dependencies:
npm install
You can configure the server port by creating a .env file in the root directory (optional, defaults to port 3000):
PORT=3000Start the production server:
npm startOr run in development mode:
npm run devTo run the URL parser and metadata scraper tests:
node test.jsTo run the Express server integration tests:
node test-server.js- Host this server on a public domain (e.g., using Fly.io, Railway, Render, or a VPS with Nginx and PM2). Make sure SSL (HTTPS) is enabled, as Discord requires HTTPS for player embeds.
- When sharing a Facebook link, replace the hostname
facebook.com(orwww.facebook.com,m.facebook.com, etc.) with your custom domain (e.g.,xfa-fb.comoryourdomain.com). - Example:
- Original link:
https://www.facebook.com/share/r/18EhyfvqST/ - Modified link:
https://yourdomain.com/share/r/18EhyfvqST/
- Original link:
- Discord will fetch the link, parse the OpenGraph/oEmbed tags returned by your server, and show a beautiful inline video player. Normal users who click the link in Discord will be seamlessly redirected back to the official Facebook post.