summary refs log tree commit diff
diff options
context:
space:
mode:
authorSerkora <Serkora@users.noreply.github.com>2016-12-08 00:46:42 +0800
committerSergey M <dstftw@gmail.com>2016-12-07 23:46:42 +0700
commit7441915b1e53e2a26f4c78796c4755a36b9e1b8d (patch)
treecc81427ca6c0a817c3dd157531dab18d80bd87d2
parent283d1c6a8bec0150a498c6909893179335f06f0f (diff)
downloadyoutube-dl-7441915b1e53e2a26f4c78796c4755a36b9e1b8d.tar.gz
youtube-dl-7441915b1e53e2a26f4c78796c4755a36b9e1b8d.tar.xz
youtube-dl-7441915b1e53e2a26f4c78796c4755a36b9e1b8d.zip
[pandoratv] Fix extraction (closes #11023)
-rw-r--r--youtube_dl/extractor/pandoratv.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/youtube_dl/extractor/pandoratv.py b/youtube_dl/extractor/pandoratv.py
index 2b07958bb..3e37ae01d 100644
--- a/youtube_dl/extractor/pandoratv.py
+++ b/youtube_dl/extractor/pandoratv.py
@@ -5,12 +5,14 @@ from .common import InfoExtractor
 from ..compat import (
     compat_str,
     compat_urlparse,
+    compat_urllib_request,
 )
 from ..utils import (
     ExtractorError,
     float_or_none,
     parse_duration,
     str_to_int,
+    urlencode_postdata,
 )
 
 
@@ -56,6 +58,18 @@ class PandoraTVIE(InfoExtractor):
                 r'^v(\d+)[Uu]rl$', format_id, 'height', default=None)
             if not height:
                 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({
                 'format_id': '%sp' % height,
                 'url': format_url,