fent / node-ytdl-core

YouTube video downloader in javascript.
MIT License
4.49k stars 794 forks source link

some required Youtube Video Fields #266

Closed Zorono closed 6 years ago

Zorono commented 6 years ago

Hello everybody, so iam iam trying to find some fields smilliar to Likes + Dislikes + Upload Date... on the project but i couldn't find any of them i tried searching on https://github.com/fent/node-ytdl-core/blob/master/example/info.json please some help

TimeForANinja commented 6 years ago

there's at least average rating and published

fent commented 6 years ago

^As above, average rating is there from the days when YouTube used to have 1 to 5 star rating. These days, it's calculated from likes/dislikes. I'm not positive of the calculation, but from a quick test on a video with 4000 likes and 40 dislikes, and an avg_rating of 4.9656, a like is treated as a 5 rating and a dislike as a 1.

((4000 * 5 + 40 * 1) / ((4000 + 40) * 5)) * 5 = 4.9603

You can't get the likes/dislikes from the rating though. But since they're on the /watch page, they could be scraped.