1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-08 04:02:40 +01:00

[pandoratv] Fix extraction (closes #11023)

This commit is contained in:
Serkora 2016-12-08 00:46:42 +08:00 committed by Sergey M
parent 283d1c6a8b
commit 7441915b1e

View File

@ -5,12 +5,14 @@
from ..compat import ( from ..compat import (
compat_str, compat_str,
compat_urlparse, compat_urlparse,
compat_urllib_request,
) )
from ..utils import ( from ..utils import (
ExtractorError, ExtractorError,
float_or_none, float_or_none,
parse_duration, parse_duration,
str_to_int, str_to_int,
urlencode_postdata,
) )
@ -56,6 +58,18 @@ def _real_extract(self, url):
r'^v(\d+)[Uu]rl$', format_id, 'height', default=None) r'^v(\d+)[Uu]rl$', format_id, 'height', default=None)
if not height: if not height:
continue continue
post_data = {'prgid': video_id, 'runtime': info.get('runtime'), 'vod_url': format_url}
play_url = self._download_json('http://m.pandora.tv/?c=api&m=play_url', video_id,
data=urlencode_postdata(post_data),
headers={
'Origin': url,
'Content-Type': 'application/x-www-form-urlencoded'
})
format_url = play_url.get('url')
if not format_url:
continue
formats.append({ formats.append({
'format_id': '%sp' % height, 'format_id': '%sp' % height,
'url': format_url, 'url': format_url,