how do I get the author/username from an object using:
GetYouTubeVideoEntry(video_id=youtube_video_id_to_output)
I'm using Google's gdata.youtube.service Python library
Thanks in advance! :)
So because YouTube's API is based on GData, which is based on Atom, the 'author' object is an array with name objects, which can contain names, URLs, etc.
This is what you want:
>>> client = gdata.youtube.service.YouTubeService()
>>> video = client.GetYouTubeVideoEntry(video_id='CoYBkXD0QeU')
>>> video.author[0].name.text
'GoogleDevelopers'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With