fb-metadata-recovery
Recover original publish dates for Facebook photos and videos that get stripped during upload.
The Problem
When you upload photos/videos to Facebook, the original EXIF metadata (including capture date) is stripped. When you later use Facebook's "Download Your Information" tool, the compressed files have incorrect or missing dates. This tool helps you rebuild that metadata.
Quick Start
pip install fb-metadata-recovery
fb-recovery download -o ~/fb_photos
How It Works
- Download your photos from Facebook via Graph API (organized by album)
- Parse your Facebook bulk download HTML files for metadata
- Match items using perceptual hashing to handle Facebook's re-compression
- Recover original publish dates and rename files accordingly
Setup
1. Get a Facebook Access Token
- Go to Facebook Graph API Explorer
- Create or select an app
- Click Generate Access Token
- Select permissions:
user_photos- Access your photosuser_videos- Access your videosuser_posts- Access your posts (optional)
- Copy the token
2. Download Your Information from Facebook
- Go to Facebook Settings → Your Information → Download Your Information
- Select:
- Format: JSON
- Quality: High (for best matching)
- Date range: All time
- Select: Posts, Photos, Videos
- Download and extract the ZIP file
Usage
Download All Photos (by album)
fb-recovery download -o ~/fb_photos
Creates folder structure:
fb_photos/
├── Total Carnage/
│ ├── 2012-04-10_Total Carnage_3771498489821.jpg
│ └── ...
├── Halloween 2011/
│ ├── 2011-11-13_Halloween 2011_2636658399528.jpg
│ └── ...
└── download_metadata.json
Parse Facebook Bulk Download
fb-recovery parse ~/Downloads/facebook-yourname-20240101/ -o metadata.json
Extracts dates, camera info, and captions from Facebook's HTML export.
Match & Recover Dates
fb-recovery match metadata.json --bulk-dir ~/fb_export/ -o report.csv
Matches photos between Graph API and bulk download to recover original dates.
Full Pipeline
fb-recovery full --bulk-dir ~/Downloads/facebook-export/ -o output/
Output Formats
| File | Description |
|---|---|
photos_metadata.csv |
Photos with dates, camera info, CDN URLs |
videos_metadata.csv |
Videos with dates, titles, file paths |
download_metadata.json |
Full metadata for all media |
recovery_report.csv |
Matched items with recovered dates |
Commands
| Command | Description |
|---|---|
fb-recovery download |
Download all photos via Graph API (by album) |
fb-recovery parse |
Parse Facebook HTML export for metadata |
fb-recovery match |
Match scan results against bulk download |
fb-recovery scan |
List all photos/videos from Graph API |
fb-recovery full |
Run full pipeline |
Token Caching
Your access token is cached at ~/.fb-metadata-recovery/token.json with restricted permissions (600). To clear it:
rm ~/.fb-metadata-recovery/token.json
Privacy
This tool runs entirely locally. Your access token and media files never leave your machine. No data is sent to third parties.
License
MIT
Metadata
Release files for fb-metadata-recovery 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fb_metadata_recovery-0.1.0.tar.gz | 16.8 kB | Without provenance | Details for fb_metadata_recovery-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fb_metadata_recovery-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for fb_metadata_recovery-0.1.0-py3-none-any.whl |
Total release size: 37.1 kB
Release files / fb_metadata_recovery-0.1.0.tar.gz
| Download URL | fb_metadata_recovery-0.1.0.tar.gz |
|---|---|
| Size | 16.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
96c1a2b3b43be19f77889ddb081c19d6b6382bbb5deb1347d1d1e530f06f6307
|
|
BLAKE2b-256 checksum How to use checksums |
268def6e10ff3d904b239fad3955c71cca6195b8e1f33f83df14135e0c19efd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / fb_metadata_recovery-0.1.0-py3-none-any.whl
| Download URL | fb_metadata_recovery-0.1.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf50ebd4bcec4b4f6300b13f5b5cc944d95dde75de765e208e108ab9a07d43d5
|
|
BLAKE2b-256 checksum How to use checksums |
8a5d42df022818975b5a7e5779546953abe200e56c51316338e905f833d1c1b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Security for fb-metadata-recovery 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.