I Built a Free Social Media Video Downloader in PHP — Here's How It Works

php dev.to

I recently launched SocialSave Hub (https://socialsavehub.com) — a free browser-based tool to download videos from Instagram, Facebook, and Twitter/X. Here's a quick look at how it works technically.

Architecture

Pure PHP 8.2, MVC pattern, no framework, no Composer. Hosted on shared hosting. The whole thing runs without Node.js, no npm, no build step.

How Scraping Works

Each platform has a scraper with a fallback chain:

Instagram: graphql → embed_page → page_source
Facebook: mobile_page → page_source
Twitter: syndication_api → fxtwitter_api → oembed

The scrapers hit public CDN URLs — no authentication bypassing, only publicly accessible content.

Stack

  • Backend: PHP 8.2, PDO, custom router
  • Frontend: Tailwind CDN + vanilla JS
  • DB: MySQL 8.0
  • No Composer, no npm

Key Design Decisions

  1. No watermarks — deliver the original CDN file directly
  2. No login required — zero friction for users
  3. Rate limiting — IP-based, stored in DB
  4. Cache layer — 30-min TTL on extracted URLs to reduce CDN load

The full tool is live at https://socialsavehub.com — supports Instagram Reels, Facebook videos, Twitter/X videos and GIFs.

php #webdev #buildinpublic #opensource

Source: dev.to

arrow_back Back to Tutorials