z0r3f / wallbot

wallapop search bot
GNU General Public License v3.0
25 stars 5 forks source link

Fallo adquiriendo JSON #7

Open Albertoyl opened 2 months ago

Albertoyl commented 2 months ago

Muy buen proyecto, no funciona debido a que wallapop no detecta un user agent y bloquea el envio de la informacion, he añadido al codigo un fake user agent y funciona perfectamente.

Añado nuevo Dockerfile --- pip3 install fake-useragent Añado nuevo ssbo.py con fake user agent incluido https://drive.google.com/file/d/1b5rY2sZ354xxn9caayqHgLRkWkzn9Kc7/view?usp=drive_link

RUN ON CONTAINER usar linea :

docker run --name wallbot --env BOT_TOKEN="YOUR-TOKEN" z0r3f/wallbot-docker:latest

Muchas gracias

thyaguster commented 2 months ago

Your link is locked.

Albertoyl commented 2 months ago

Ok, now must be unlocked.

thyaguster commented 2 months ago

Thanks. I did end up doing it myself in the meantime, but was having issues with the fake-useragent module, docker kept saying it wasn't installed.

So I just added this on top: headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}

And replaced: response = requests.get(url=url) With: response = requests.get(url=url, headers=headers)

elsorro commented 2 months ago

Es posible lanzarlo en raspberry ??

Después de seguir los pasos tengo este error:

2024-08-21 23:27:01,154 (init.py:544 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 409. Description: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"