FBReelz is a headless-friendly toolchain for:
- Pulling Facebook Saved videos
- Downloading reels/videos locally
- Generating M3U playlists
- Serving content over NGINX
📖 Full write-up on my blog: makes.swakes.co.uk
- Headless Playwright scraping
- yt-dlp based downloads
- HTTP-friendly playlists
- Docker-first deployment
- Docker + Docker Compose
- Facebook cookies (Netscape format)
- NGINX (host-level)
cp secrets/cookies.example.txt secrets/cookies.txt
docker compose up -d --buildThis option:
- runs your FBReelz scripts inside a container called
fbreelz - keeps cookies and data on the host under
/opt/fbreelz/ - uses NGINX on the host to serve the web UI + cached MP4s + playlists
sudo apt update
sudo apt install -y docker.io docker-compose-plugin nginx
sudo systemctl enable --now docker nginxRecommended destination:
sudo mkdir -p /opt/fbreelz
sudo chown -R $USER:$USER /opt/fbreelz
cp -r docker_setup/* /opt/fbreelz/Cookies are obtained using the cookies.txt Firefox extension.
mkdir -p /opt/fbreelz/secrets
nano /opt/fbreelz/secrets/cookies.txt
chmod 600 /opt/fbreelz/secrets/cookies.txtcd /opt/fbreelz
docker compose up -d --build
docker exec -it fbreelz python /app/fbreelz_phase1_graphql.py --max 30
docker exec -it fbreelz python /app/fbreelz_phase2_resolve.py --downloadThis creates /opt/fbreelz/data/fbreelz_cache_http.m3u pointing at your server IP.
python3 /opt/fbreelz/make_cache_playlist.py \
--base-url http://YOUR_SERVER_IP/cache/ \
--out /opt/fbreelz/data/fbreelz_cache_http.m3usudo cp /opt/fbreelz/nginx/fbreelz.conf /etc/nginx/sites-available/fbreelz
sudo ln -sf /etc/nginx/sites-available/fbreelz /etc/nginx/sites-enabled/fbreelz
sudo nginx -t && sudo systemctl reload nginxThen open:
http://YOUR_SERVER_IP/(Web UI)http://YOUR_SERVER_IP/fbreelz_cache_http.m3u(playlist)
The FBReelz Web UI is a static frontend served directly by NGINX on the host. It does not run inside Docker and does not require Node.js at runtime.
Browser
├─ / → Static Web UI (HTML / JS / CSS)
├─ /cache/*.mp4 → Downloaded Facebook videos
├─ /fbreelz_*.m3u → Playlists
└─ /api/* → (optional) backend
Docker is only responsible for scraping, downloading, and playlist generation.
/var/www/fbreelz/
├── index.html
├── assets/
│ ├── app.js
│ ├── styles.css
│ └── icons/
Update the NGINX root directive if you change this path.
sudo mkdir -p /var/www/fbreelz
sudo cp -r web_ui/* /var/www/fbreelz/
sudo chown -R www-data:www-data /var/www/fbreelzPermissions:
sudo find /var/www/fbreelz -type d -exec chmod 755 {} \;
sudo find /var/www/fbreelz -type f -exec chmod 644 {} \;Videos are downloaded to:
/opt/fbreelz/data/cache/*.mp4
NGINX exposes them as:
http://YOUR_SERVER_IP/cache/*.mp4
Local:
/opt/fbreelz/data/fbreelz_cache.m3u
LAN / remote:
/opt/fbreelz/data/fbreelz_cache_http.m3u
Example entry:
#EXTINF:97,Ten Years of Dancehall
http://192.168.x.xxx/cache/facebook_2107482286680757.mp4Recommended:
sendfile ontcp_nopush on- correct MIME types for
.mp4and.m3u
Avoid:
aio on- gzip on video files
- Web UI:
http://YOUR_SERVER_IP/ - Playlist:
http://YOUR_SERVER_IP/fbreelz_cache_http.m3u - Videos:
http://YOUR_SERVER_IP/cache/
- Never expose
cookies.txt - Restrict
/opt/fbreelz/secrets - Use HTTPS if exposed beyond LAN
Private / internal use. Adjust as required.
