facebook-delete icon indicating copy to clipboard operation
facebook-delete copied to clipboard

Allow for a custom User-Agent header at runtime

Open jdoss opened this issue 2 years ago • 4 comments

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.

jdoss avatar Oct 12 '21 21:10 jdoss

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

G2G2G2G avatar Oct 12 '21 22:10 G2G2G2G

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

marcelja avatar Oct 13 '21 06:10 marcelja

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

ullbergm avatar Oct 13 '21 22:10 ullbergm

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

marcelja avatar Oct 20 '21 10:10 marcelja