From 5179a4fcf97ec89d41fdbdc1750fd72597d20e06 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 15 Jan 2014 22:03:39 +0530 Subject: [PATCH] add yt 4k format --- ox/web/youtube.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ox/web/youtube.py b/ox/web/youtube.py index 7b12c08..3d0f9d4 100644 --- a/ox/web/youtube.py +++ b/ox/web/youtube.py @@ -10,7 +10,7 @@ import feedparser import ox from ox.cache import read_url, cache_timeout - + def video_url(youtubeId, format='mp4', timeout=cache_timeout): """ youtubeId - if of video @@ -19,9 +19,11 @@ def video_url(youtubeId, format='mp4', timeout=cache_timeout): def get_url(stream): return '%s&signature=%s' % (stream['url'], stream['sig']) fmt = None - if format == '1080p': + if format == '4k': + fmt=38 + elif format == '1080p': fmt=37 - if format == '720p': + elif format == '720p': fmt=22 elif format == 'mp4': fmt=18