add 720p video links

This commit is contained in:
j 2008-12-09 19:09:12 +01:00
parent 037bd575bf
commit 141294fee0

View file

@ -28,7 +28,10 @@ def getVideoKey(youtubeId):
def getVideoUrl(youtubeId, format='mp4'):
youtubeKey = getVideoKey(youtubeId)
if format == 'mp4':
if format == '720p':
fmt=22
url = "http://youtube.com/get_video.php?video_id=%s&t=%s&fmt=%s" % (youtubeId, youtubeKey, fmt)
elif format == 'mp4':
fmt=18
url = "http://youtube.com/get_video.php?video_id=%s&t=%s&fmt=%s" % (youtubeId, youtubeKey, fmt)
else:
@ -58,6 +61,7 @@ def getInfoFromAtom(entry, video_url_base=None):
else:
info['flv'] = getVideoUrl(info['id'], 'flv')
info['mp4'] = getVideoUrl(info['id'], 'mp4')
info['720p'] = getVideoUrl(info['id'], '720p')
info['embed'] = '<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/%s&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/%s&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>' % (info['id'], info['id'])
return info