add yt 4k format

This commit is contained in:
j 2014-01-15 22:03:39 +05:30
parent 2456ec2d5a
commit 5179a4fcf9

View file

@ -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