feat: facebook scraping
Signed-off-by: Dmytro Stanchiev <git@dmytros.dev>
This commit is contained in:
52
cookies/README.md
Normal file
52
cookies/README.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Facebook Marketplace Cookies Setup
|
||||
|
||||
To use the Facebook Marketplace scraper, you need to provide valid Facebook session cookies.
|
||||
|
||||
## Option 1: Cookies File (`facebook.json`)
|
||||
|
||||
1. Log into Facebook in your browser
|
||||
2. Open Developer Tools → Network tab
|
||||
3. Visit facebook.com/marketplace (ensure you're logged in)
|
||||
4. Look for any marketplace-related requests in the Network tab
|
||||
5. Export cookies from the browser's Application/Storage → Cookies section
|
||||
6. Save the cookies as a JSON array to `facebook.json`
|
||||
|
||||
The `facebook.json` file should contain Facebook session cookies, particularly:
|
||||
- `c_user`: Your Facebook user ID
|
||||
- `xs`: Facebook session token
|
||||
- `fr`: Facebook request token
|
||||
- `datr`: Data attribution token
|
||||
- `sb`: Session browser token
|
||||
|
||||
Example structure:
|
||||
```json
|
||||
[
|
||||
{
|
||||
"name": "c_user",
|
||||
"value": "123456789",
|
||||
"domain": ".facebook.com",
|
||||
"path": "/",
|
||||
"secure": true
|
||||
},
|
||||
// ... other cookies
|
||||
]
|
||||
```
|
||||
|
||||
## Option 2: URL Parameter
|
||||
|
||||
You can pass cookies directly via the `cookies` URL parameter:
|
||||
|
||||
```
|
||||
GET /api/facebook?q=laptop&cookies=[{"name":"c_user","value":"123","domain":".facebook.com",...}]
|
||||
```
|
||||
|
||||
## Important Notes
|
||||
|
||||
- Cookies must be from an active Facebook session
|
||||
- Cookies expire, so you may need to refresh them periodically
|
||||
- Never share real cookies or commit them to version control
|
||||
- Facebook may block automated scraping even with valid cookies
|
||||
|
||||
## Security
|
||||
|
||||
The cookies file is intentionally left out of version control for security reasons.</content>
|
||||
Reference in New Issue
Block a user