1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-25 11:41:52 +00:00

[yahoo] Update extraction process

Their webpage uses now https://video.media.yql.yahoo.com/v1/video/sapi/streams/ for getting the video info.
This commit is contained in:
Jaime Marquínez Ferrándiz 2014-12-21 14:47:44 +01:00
parent 85fab7e47b
commit 653d14e2f9

View file

@ -176,17 +176,15 @@ class YahooIE(InfoExtractor):
region = self._search_regex( region = self._search_regex(
r'\\?"region\\?"\s*:\s*\\?"([^"]+?)\\?"', r'\\?"region\\?"\s*:\s*\\?"([^"]+?)\\?"',
webpage, 'region', fatal=False, default='US') webpage, 'region', fatal=False, default='US')
query = ('SELECT * FROM yahoo.media.video.streams WHERE id="%s"'
' AND plrs="86Gj0vCaSzV_Iuf6hNylf2" AND region="%s"'
' AND protocol="http"' % (video_id, region))
data = compat_urllib_parse.urlencode({ data = compat_urllib_parse.urlencode({
'q': query, 'protocol': 'http',
'env': 'prod', 'region': region,
'format': 'json',
}) })
query_url = (
'https://video.media.yql.yahoo.com/v1/video/sapi/streams/'
'{id}?{data}'.format(id=video_id, data=data))
query_result = self._download_json( query_result = self._download_json(
'http://video.query.yahoo.com/v1/public/yql?' + data, query_url, display_id, 'Downloading video info')
display_id, 'Downloading video info')
info = query_result['query']['results']['mediaObj'][0] info = query_result['query']['results']['mediaObj'][0]
meta = info.get('meta') meta = info.get('meta')