iFraan / vandal.js

Wrapper for Valorant stats api
GNU General Public License v3.0
2 stars 1 forks source link

Unexpected token < in JSON at position 0 #3

Open iamblackbull opened 1 year ago

iamblackbull commented 1 year ago

Hi, your package works perfectly fine in windows. but it returns this error everytime i run it in ubuntu (curl version 7.88.1) . Screenshot (116)

i can see someone almost had a problem like this before (https://github.com/iFraan/vandal.js/issues/1#issue-1231884488) but in his case the unexpected token was e . Mine is < and i saw you said use this command in console : curl --max-time 5 --user-agent 'Chrome/99' --url https://api.tracker.gg/api/v2/valorant/standard/profile/riot/iFraan%23G4G I did and it returns a html file. so i guess thats the problem. it shouldn't return an html file.

Screenshot (115)

iFraan commented 1 year ago

Seems like cloudfare is trying to check your browser. Imma get an ubuntu vm running, what version are you using?

iamblackbull commented 1 year ago

im using ubuntu 22.04

iamblackbull commented 1 year ago

any updates?

idroid007 commented 1 year ago

its because, it is detecting this request as a bot. you may copy the headers as samse as you see in browser or use puppeteer extra