marcelja / facebook-delete

Fast facebook activity deletion
MIT License
1.28k stars 48 forks source link

Allow for a custom User-Agent header at runtime #33

Open jdoss opened 2 years ago

jdoss commented 2 years ago

Facebook seems to be rate limiting hard for anyone that uses this program. They might be looking at requests that are coming into https://mbasic.facebook.com and checking the User-Agent header which defaults to Go-http-client/1.1 in net/http and blocking people.

Allowing a user to set a random common User-Agent at runtime might help with the rate limiting.

G2G2G2G commented 2 years ago

Agreed, alternatively randomize them. This has several hundred (maybe thousand) for every os, console, browser, etc: https://github.com/ray-lothian/UserAgent-Switcher/

Also facebook used to store real time cookies for screen size. Now it's a periodically updated cookie called "wd" it's likely they still do it real time somewhere else, implementing that would require executing their javascript though... scratch that, just realized it's the mbasic one being used which doesn't have the wd cookie.. it's more likely we're going to see facebook rate limit mbasic as a whole rather than allow people to use this lmao

marcelja commented 2 years ago

What about we start by setting the user agent to a very common one?

ullbergm commented 2 years ago

I did some testing and I didn't have much luck when changing the User-Agent header. I did get different failure scenarios depending on the User-Agent I sent so i think the code works. If you have better luck, please let me know.

https://github.com/ullbergm/facebook-delete

marcelja commented 2 years ago

I played around with some user agents. I only received error pages. That's interesting. I would've expected it the other way around.