From 141294fee094e5df2cdbe66d839e7d34119d1cb3 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 9 Dec 2008 19:09:12 +0100 Subject: [PATCH] add 720p video links --- oxweb/youtube.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/oxweb/youtube.py b/oxweb/youtube.py index 6d1aab5..a7c44f4 100644 --- a/oxweb/youtube.py +++ b/oxweb/youtube.py @@ -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'] = '' % (info['id'], info['id']) return info