diff --git a/oxweb/youtube.py b/oxweb/youtube.py index cf640c9..a6d1392 100644 --- a/oxweb/youtube.py +++ b/oxweb/youtube.py @@ -19,12 +19,18 @@ def getVideoKey(youtubeId): def getVideoUrl(youtubeId, format='mp4'): youtubeKey = getVideoKey(youtubeId) + if format == '1080p': + fmt=37 + url = "http://youtube.com/get_video.php?video_id=%s&t=%s&fmt=%s" % (youtubeId, youtubeKey, fmt) 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) + elif format == 'high': + fmt=35 + url = "http://youtube.com/get_video.php?video_id=%s&t=%s&fmt=%s" % (youtubeId, youtubeKey, fmt) else: url = "http://youtube.com/get_video.php?video_id=%s&t=%s" % (youtubeId, youtubeKey) return url @@ -51,8 +57,10 @@ def getInfoFromAtom(entry, video_url_base=None): info['mp4'] = "%s/%s.%s" % (video_url_base, info['id'], 'mp4') else: info['flv'] = getVideoUrl(info['id'], 'flv') + info['flv_high'] = getVideoUrl(info['id'], 'high') info['mp4'] = getVideoUrl(info['id'], 'mp4') info['720p'] = getVideoUrl(info['id'], '720p') + info['1080p'] = getVideoUrl(info['id'], '1080p') info['embed'] = '' % (info['id'], info['id']) return info