parse youtube video likes dislikes using gadata API [closed]
-
29-10-2019 - |
Frage
I am using python and the gdata library to parse the info of a youtube video. My code is this:
yt_service = gdata.youtube.service.YouTubeService()
entry = yt_service.GetYouTubeVideoEntry(video_id='someid')
but in the entry.rating
or entry.statistics
there is no likes/dislikes
Where can I get that info from?
Lösung
Once I use Python 3 and the gdata library doesn't have support for it I couldn't reproduce the results.
But as far as I know, the entry.rating
returns a xml code with the whole statistic content of the video.
For a more specific result you should try entry.rating.average
or entry.rating.num_raters
Andere Tipps
Looking at the source of the gdata
library, it doesn't seem that it supports YouTube's like/dislike Gdata <yt:rating>
element, only the generic <gd:rating>
element.
If you are able to somehow access the underlying XML element through the library (I haven't used it myself), you should be able to get your hands at the YouTube rating element (qualified name should be {http://gdata.youtube.com/schemas/2007}rating
, if that helps :) ).
Even better, if you are able to patch the library to actually natively support that element, all the better. I'm sure the authors would appreciate a patch. :)