kevinzg / facebook-scraper

Scrape Facebook public pages without an API key
MIT License
2.35k stars 626 forks source link

Passing cookies as JSON [bug] #270

Closed fashan7 closed 3 years ago

fashan7 commented 3 years ago

I was passing cookies as JSON format, the script didn't extract the expected post. but Netscape format gave the expected JSON.

Passed as JSON cookies, below is the result

`{
   "original_request_url":"https://m.facebook.com/story.php?story_fbid=1781867791974810&id=284294775065460&_rdr",
   "post_url":"https://m.facebook.com/story.php?story_fbid=1781867791974810&id=284294775065460&_rdr"
}`

Note: passing as cookies as JSON is basically not working

neon-ninja commented 3 years ago

Working fine for me, what does the structure of your JSON look like?

fashan7 commented 3 years ago

[{,,,,,},{,,,,,}] list type

@neon-ninja

neon-ninja commented 3 years ago

key names?

fashan7 commented 3 years ago

@neon-ninja please chk ur mail

fashan7 commented 3 years ago

i ve send u a working cookies can test

neon-ninja commented 3 years ago

You should only feed the scraper cookies for the https://.facebook.com/ domain, and not all these other domains

neon-ninja commented 3 years ago

Maybe these cookies just aren't valid any more, just regenerate them?

fashan7 commented 3 years ago

these are latest cookies

fashan7 commented 3 years ago

@neon-ninja In JSON template it gives expiry but Netscape template haven't expiry? which template is good for long term?

fashan7 commented 3 years ago

i think in read me u can add this extension too https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg/related?hl=en

Screenshot 2021-05-18 at 15 32 45
neon-ninja commented 3 years ago

this should fix it https://github.com/kevinzg/facebook-scraper/commit/168a245aa94f2a01710d938be7308732862c8b55. Netscape format has expiry as a unix timestamp

fashan7 commented 3 years ago

@neon-ninja what is this update

neon-ninja commented 3 years ago

the extension Cookie Quick Manager's JSON format passes a domain like this "https://.facebook.com/" when it should be like this ".facebook.com"