Firefox cache extractor.
FFCACHE_DIR=~/.cache/mozilla/firefox/hoge.default/cache2 ffcache --list
FFCACHE_DIR=~/.cache/mozilla/firefox/hoge.default/cache2 ffcache --key https://example.com/image.png --out myimage.png
[usage]
ffcache [OPTIONS]
--list -l list all keys
--cache -c cache2 directory
--key -k key
--out -o output path
pip install ffcache
from ffcache import FirefoxCache, FirefoxCacheEntry
from ffcache.helper import save
import urllib.parse
import os
import brotli
import gzip
import zlib
import sys
cache_dir = os.environ['FFCACHE_DIR']
out_dir = 'tmp'
if not os.path.exists(out_dir):
os.mkdir(out_dir)
cache = FirefoxCache(cache_dir)
for entry in cache.records:
url = entry.key
print(url)
filename = urllib.parse.quote(url, safe='')[:255]
out_path = os.path.join(out_dir, filename)
try:
save(entry, out_path)
except:
pass
download artifacts from here or manually build.
sudo apt-get install -y g++ python3.8-dev make python3-pip
pip3 install pybind11
make
sudo docker-compose up --build
- specify python version in
docker-compose.yml
(default python3.8)