3 ms·
Just npm install puppeteer.
by eurasiantiger 4y ago
Just npm install puppeteer.
- lolinder 4y agoPuppeteer is cool, but it's exactly what OP is warning against: it's a full browser that is downloaded and run through npm. It's remarkably well packaged, but still far more error prone than a simple HTTP request, and far more likely to break on its own just with the passage of time.
- eurasiantiger 4y agoYes, but: ”Your simple script goes from being small, simple, self-contained, and elegant gem, to requiring a full browser, specialized drivers, and/or daemons running just to work” Complex problems cannot be solved by simple scripts, but they can be abstracted away to vendor libraries when/if they are well maintained, such as in this case. While it can break with time, at least someone else fixes it for you.
- ciupicri 4y agoThere's also puppeteer-core which lets you use your own (Google Chrome) browser and if your own browser is broken then you're having bigger problems than youtube-dl not working.
- ciupicri 4y agoBy the way there is also Playwright [1] and it has Python bindings too [2]. [1]: https://playwright.dev/ https://playwright.dev/ [2]: https://playwright.dev/python/docs/intro https://playwright.dev/python/docs/intro