Retrieving Youtube Video

I want to get the number of views, duration, as well as the rating of a specific video on YouTube. Is there a way to get the video information by passing the video id via the URL?

+2
source share
3 answers

Youtube Data API.

Basically, you want to get a URL, for example, http://gdata.youtube.com/feeds/api/videos/kpcqAm8BOlE and look at the resulting XML.

+7
source

, YouTube AJAX , JavaScript / AJAX, API YouTube, , API.

+2

for rating, you can parse the video URL and find:

<button class="master-sprite ratingL ratingL-5.0" title="5.0"></button></div><div id="ratingMessage" ><div id="defaultRatingMessage"><span class="smallText">719 ratings

notice 5.0 and 719 are here. 5.0 is the rating, and 719 is the number of votes.

0
source

Source: https://habr.com/ru/post/1758736/


All Articles