syuilo / summaly

🔍 Get a summary of any web page
MIT License
47 stars 24 forks source link

Fix youtube previews #143

Open foldedcascode opened 3 years ago

foldedcascode commented 3 years ago

youtube (at least in the EU) has a new forced redirect to a cookie consent page when you connect with their cookie. resetting the cheerio-httpcli client is the only way to clear its cookies, so here i just do that before every request. overkill, but it works. added shrinkwrap because i wasn't able to get it to build consistently without it

mei23 commented 3 years ago

cheerio-httpcli currently supports multiple instances. So it might be better to use that function.

https://github.com/mei23/summaly/blob/7d848453e94642c9590158f903ad8e0c17aeeb28/src/client.ts#L1-L12 https://github.com/mei23/summaly/blob/7d848453e94642c9590158f903ad8e0c17aeeb28/src/general.ts#L9-L13 :