ptrumpis / snap-lens-tool

A Swiss Army Knife for Snapchat Lenses.
https://github.com/snapcamera
MIT License
14 stars 8 forks source link

403 Client error #21

Open fusionhead opened 2 weeks ago

fusionhead commented 2 weeks ago

When trying to search a filter, i got this error

403 Client Error: Forbidden for url: https://www.snapchat.com/lens/6ac2c0c06ef347219d6c9f36027f0e7a

I'm using the latest Snap Lens Tool (v0.7.0), phython 3.10.0, pip 24.3.1 and all requirement already satisfied. What did i do wrong? thank you.

roastcom commented 1 week ago

What happens there is the 'fake browser' that the web crawler pretends to be doesn't look authentic enough to the host.

Go to the file ..\src\core\lens_crawler.py and modify line 36 as follows: BEFORE: response = requests.get(url) AFTER: def_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0' header = {'user-agent': def_agent, 'referer': url} response = requests.get(url,headers=header)

That should do it.