damonwonghv / youtube-search-api

Get Youtube Search result without any login or api key
MIT License
86 stars 30 forks source link

Is there a way to specify the country? #16

Closed ben1one closed 1 year ago

ben1one commented 1 year ago

When I use it in localhost it is perfect. But when I deploy to GIthub action and run it, it doesn't give the same content. Would be very useful to get local contents for users. I tried add &persist_gl=1&gl=HK and no hope.

ben1one commented 1 year ago

This seem to be working

const page = await axios.get(encodeURI(url)+"&persist_hl=1&hl=ja&persist_gl=1&gl=JP");
damonwonghv commented 1 year ago

This seem to be working


const page = await axios.get(encodeURI(url)+"&persist_hl=1&hl=ja&persist_gl=1&gl=JP");

Apology for the late reply, I will test it, if work fine, I will put it in next release.

damonwonghv commented 1 year ago

Not really work, since location change only works when you use VPN or proxy, Youtube does not allow you to change your real location via some easy config (query=JP), so I think no workaround solution at this moment. Maybe I will make a Docker container to allow easy switch location by proxy or other technic.