pass on timeout

This commit is contained in:
j 2010-12-27 18:56:11 +05:30
parent 2a7e415271
commit c09c6c156c
2 changed files with 5 additions and 1 deletions

View file

@ -47,7 +47,7 @@ def find(query, max_results=DEFAULT_MAX_RESULTS, timeout=DEFAULT_TIMEOUT):
>>> find("The Matrix site:imdb.com", 1)[0][1] >>> find("The Matrix site:imdb.com", 1)[0][1]
u'http://www.imdb.com/title/tt0133093/' u'http://www.imdb.com/title/tt0133093/'
""" """
_results = _find(query) _results = _find(query, timeout=timeout)
results = [] results = []
for r in _results: for r in _results:
results.append((r['titleNoFormatting'], r['unescapedUrl'], stripTags(r['content']))) results.append((r['titleNoFormatting'], r['unescapedUrl'], stripTags(r['content'])))

View file

@ -23,6 +23,10 @@ def getVideoKey(youtubeId, timeout=cache_timeout):
return False return False
def getVideoUrl(youtubeId, format='mp4', timeout=cache_timeout): def getVideoUrl(youtubeId, format='mp4', timeout=cache_timeout):
"""
youtubeId - if of video
format - video format, options: webm, 1080p, 720p, mp4, high
"""
youtubeKey = getVideoKey(youtubeId, timeout=timeout) youtubeKey = getVideoKey(youtubeId, timeout=timeout)
fmt = None fmt = None