Skip to content

Reverse-engineered Facebook BitMap Codec implementation in Python. Generates valid __dyn, __csr, __hsdp, and __sjsp parameters using RLE & Custom Base64.

Notifications You must be signed in to change notification settings

NiceDayZc/FacebookCodec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Facebook BitMap Codec (Python)

Python License Status

A professional Python tool for encoding and decoding Facebook API parameters.

This project implements a reverse-engineered compression algorithm used by Facebook (BitMap + Run-Length Encoding + Custom Base64) to manage critical API parameters. It allows you to generate 100% valid and authentic-looking request payloads.

πŸš€ Key Features

  • Universal Support: Fully compatible with all parameters utilizing BitMap techniques:
    • __dyn (Dynamic Loaded Modules)
    • __csr (Client Side Resources / CSS)
    • __hsdp (HTML Server Data Parameter)
    • __hblp (HTML BigPipe Last Parameter)
    • __sjsp (Server JS Parameter)
  • Reversible Logic: Seamlessly converts between raw IDs and encoded strings with zero data loss.
  • Safety Filter: Built-in protection against memory overflow errors by automatically filtering out invalid or excessively large IDs (e.g., timestamps).
  • Clean & Professional: Implemented as a clean, easy-to-use Python class (FacebookCodec) with type hinting support.

πŸ› οΈ Installation

  1. Clone this repository to your local machine:

    git clone https://github.com/NiceDayZc/FacebookCodec.git
    cd FacebookCodec
  2. Ensure that FCodec.py is present in your project directory.

πŸ’» Usage

Simply import the FacebookCodec class from FCodec.py to get started.

1. Encoding

Use this to generate parameters like __dyn or __csr for your API requests.

from FCodec import FacebookCodec

# Initialize the codec
codec = FacebookCodec()

# Example list of IDs (e.g., extracted from 'rsrcMap' in HTML)
js_modules = [17, 25, 30, 100, 101, 102, 500] 

# Generate the encoded string
dyn_value = codec.encode(js_modules)

print(f"Generated __dyn: {dyn_value}")
# Output: 7xeUjGU... (Ready-to-use string)

About

Reverse-engineered Facebook BitMap Codec implementation in Python. Generates valid __dyn, __csr, __hsdp, and __sjsp parameters using RLE & Custom Base64.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages