Skip to content

Commit 3af9c3a

Browse files
committed
feat: Add Quick Start Guide and enhance testing scripts
- Introduced QUICK_START.md for API testing instructions, including cookie management and testing options. - Added test_upload_and_generation.py to validate image upload and media generation workflows. - Created test_uvicorn.py for smoke testing the uvicorn server endpoints. - Implemented html_scraper.py for extracting video URLs from Meta AI conversation pages. - Developed test_network_patterns.py for comprehensive testing of API responses, SSE parsing, and cookie handling.
1 parent 72d8d4a commit 3af9c3a

23 files changed

+3315
-281009
lines changed

.env.example

Lines changed: 98 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,113 @@
11
# Meta AI API Cookie Configuration
22
# Copy this file to .env and fill in your Meta AI cookies
33

4-
# Required cookies (Get these from your browser when logged into meta.ai)
4+
# =========================================
5+
# Required Cookies (MUST be provided)
6+
# =========================================
7+
# Get these from your browser when logged into https://meta.ai
8+
9+
# Device/browser identifier cookie - REQUIRED
10+
# Extract from: DevTools > Application > Cookies > meta.ai
511
META_AI_DATR=your_datr_cookie_value
12+
13+
# Meta AI session cookie - REQUIRED
14+
# Extract from: DevTools > Application > Cookies > meta.ai
615
META_AI_ABRA_SESS=your_abra_sess_cookie_value
7-
META_AI_DPR=your_dpr_cookie_value
8-
META_AI_WD=your_wd_cookie_value
916

10-
# Optional cookies (recommended for better stability)
11-
#META_AI_JS_DATR=your_js_datr_value
12-
#META_AI_ABRA_CSRF=your_abra_csrf_value
17+
# =========================================
18+
# Critical Session Cookie (HIGHLY RECOMMENDED)
19+
# =========================================
20+
21+
# Ecto session token - Maintains session state across requests
22+
# This is the most important cookie for API functionality
23+
# Format: <uuid>.v1%3A<base64-encoded-data>
24+
# Extract from: DevTools > Application > Cookies > meta.ai
25+
# NOTE: This changes frequently and may expire, so re-extract if API calls fail
26+
META_AI_ECTO_1_SESS=your_ecto_1_sess_value
27+
28+
# =========================================
29+
# Recommended Optional Cookies
30+
# =========================================
31+
32+
# Device pixel ratio (typical: 1 or 1.25)
33+
META_AI_DPR=1.25
34+
35+
# Window dimensions (e.g., "1366x732" or "1920x1080")
36+
META_AI_WD=759x732
37+
38+
# JavaScript-based datr variant
39+
META_AI_JS_DATR=your_js_datr_value
40+
41+
# CSRF token for Meta AI
42+
META_AI_ABRA_CSRF=your_abra_csrf_value
43+
44+
# Page state cookies (static values, usually: 1)
45+
META_AI_PS_L=1
46+
META_AI_PS_N=1
47+
48+
# =========================================
49+
# Additional Cookies (For enhanced compatibility)
50+
# =========================================
1351

14-
# Additional cookies for image/video generation
1552
META_AI_C_USER=your_c_user_value
1653
META_AI_XS=your_xs_value
1754
META_AI_FR=your_fr_value
1855

56+
# Challenge verification cookie (auto-handled, optional)
57+
META_AI_RD_CHALLENGE=your_rd_challenge_value
58+
59+
# =========================================
60+
# API Configuration
61+
# =========================================
62+
1963
# Refresh interval in seconds (default: 3600 = 1 hour)
2064
META_AI_REFRESH_INTERVAL_SECONDS=3600
2165

22-
# How to get cookies:
66+
# =========================================
67+
# Proxy Configuration (Optional)
68+
# =========================================
69+
70+
# HTTP proxy URL (if needed)
71+
# Example: http://proxy.example.com:8080
72+
#META_AI_PROXY_HTTP=
73+
74+
# HTTPS proxy URL (if needed)
75+
# Example: http://proxy.example.com:8080
76+
#META_AI_PROXY_HTTPS=
77+
78+
# =========================================
79+
# How to Extract Cookies
80+
# =========================================
2381
# 1. Open browser and go to https://meta.ai
24-
# 2. Open Developer Tools (F12)
25-
# 3. Go to Application/Storage > Cookies > https://meta.ai
26-
# 4. Copy the values for: datr, abra_sess, dpr, wd, c_user, xs, fr
27-
# 5. Paste them above (without quotes)
82+
# 2. Open Developer Tools (F12 or Ctrl+Shift+I)
83+
# 3. Go to "Application" or "Storage" tab
84+
# 4. Click on "Cookies" in the left sidebar
85+
# 5. Select "https://www.meta.ai" from the list
86+
# 6. Extract these cookies in order of importance:
87+
#
88+
# CRITICAL:
89+
# --------
90+
# - ecto_1_sess (META_AI_ECTO_1_SESS) - Session state token - MOST IMPORTANT
91+
# - datr (META_AI_DATR) - Device tracking - REQUIRED
92+
# - abra_sess (META_AI_ABRA_SESS) - Session - REQUIRED
93+
#
94+
# RECOMMENDED:
95+
# -----------
96+
# - _js_datr (META_AI_JS_DATR) - JavaScript datr
97+
# - abra_csrf (META_AI_ABRA_CSRF) - CSRF protection
98+
# - dpr (META_AI_DPR) - Device pixel ratio
99+
# - wd (META_AI_WD) - Window dimensions
100+
#
101+
# OPTIONAL:
102+
# --------
103+
# - ps_l (META_AI_PS_L) - Page state (usually 1)
104+
# - ps_n (META_AI_PS_N) - Page state (usually 1)
105+
# - c_user (META_AI_C_USER) - User ID
106+
# - xs (META_AI_XS) - Session check
107+
# - fr (META_AI_FR) - Friend request
108+
#
109+
# NOTE: ecto_1_sess is the PRIMARY session identifier.
110+
# If API calls return empty responses, ecto_1_sess may be expired.
111+
# Try re-extracting it from the browser.
112+
# 7. Paste the values above (without quotes)
113+
# 8. Rename this file from .env.example to .env

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ TEST_UPDATES.md
9898
FINAL_RESULTS.md
9999
VIDEO_BREAKTHROUGH.md
100100
IMPLEMENTATION_SUMMARY.md
101+
102+
# =========================
103+
# Archive folder (old tests, debug files, etc.)
104+
# =========================
105+
archive/
101106
DEPLOYMENT_FIX.md
102107
GITHUB_ISSUE_RESPONSE.md
103108
QUICK_FIX_GUIDE.md

0 commit comments

Comments
 (0)