Cloudflare ytdl worker to be used as Video Info API from frontend js. YTDL-CFWorker responses has CORS headers for it to be usable from front end. Based on ytdl-core.
Install wrangler
update wrangler.toml with your Cloudflare Account ID and run
$ wrangler config
then
// install dependencies
$ npm i
// publish on cloudflare
$ npm run publish
-
/basicinfo/<youtube-video-id>
Response: JSON with video info and formats. Similar to ytdl-core's
ytdl.getBasicInfo()
-
/info/<youtube-video-id>
Response: JSON with video info and parsed formats (including Dash MPD & HLS m3u links). Similar to ytdl-core's
ytdl.getInfo()
- Clean responses
- More Enpoints