Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How can I get the duration of Youtube video with python?

$
0
0

How can I get the duration of Youtube video? I am trying with this...

import gdata.youtubeimport gdata.youtube.serviceyt_service = gdata.youtube.service.YouTubeService()entry = yt_service.GetYouTubeVideoEntry(video_id='the0KZLEacs')print 'Video title: %s' % entry.media.title.textprint 'Video duration: %s' % entry.media.duration.seconds

Console response

Traceback (most recent call last):  File "/Users/LearningAnalytics/Dropbox/testing/youtube.py", line 8, in <module>    entry = yt_service.GetYouTubeVideoEntry(video_id='the0KZLEacs')  File "/Library/Python/2.7/site-packages/gdata/youtube/service.py", line 210, in GetYouTubeVideoEntry    return self.Get(uri, converter=gdata.youtube.YouTubeVideoEntryFromString)  File "/Library/Python/2.7/site-packages/gdata/service.py", line 1107, in Get'reason': server_response.reason, 'body': result_body}gdata.service.RequestError: {'status': 410, 'body': 'No longer available', 'reason': 'Gone'}

Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>