diff options
author | remitamine <remitamine@gmail.com> | 2016-01-15 12:34:28 +0100 |
---|---|---|
committer | remitamine <remitamine@gmail.com> | 2016-01-15 12:35:31 +0100 |
commit | ffbc0baf72f456b1f4f4ac989e4a7b75b69c7a54 (patch) | |
tree | 31967a707aad92b6f1be37c3e15af06f9f6728fa | |
parent | 345f12196c9ed37094aec8c029809be888052d3a (diff) |
[history] fix signature and media url extraction(fixes #8240)
-rw-r--r-- | youtube_dl/extractor/history.py | 17 | ||||
-rw-r--r-- | youtube_dl/extractor/theplatform.py | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/youtube_dl/extractor/history.py b/youtube_dl/extractor/history.py index f86164afe..1866ca679 100644 --- a/youtube_dl/extractor/history.py +++ b/youtube_dl/extractor/history.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals from .common import InfoExtractor from ..utils import smuggle_url +from ..compat import compat_urllib_parse class HistoryIE(InfoExtractor): @@ -19,13 +20,21 @@ class HistoryIE(InfoExtractor): 'add_ie': ['ThePlatform'], }] + _VIDEO_URL_RE = [ + r"media_url\s*=\s*'[^']'", + r'data-mediaurl="([^"]+)"' + ] + def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - video_url = self._search_regex( - r'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id, - webpage, 'video url') + media_url = self._search_regex(self._VIDEO_URL_RE, webpage, 'video url') + + pdk_signature = webpage = self._download_webpage( + 'https://signature.video.aetndigital.com/?' + + compat_urllib_parse.urlencode({'url': media_url}), video_id) - return self.url_result(smuggle_url(video_url, {'sig': {'key': 'crazyjava', 'secret': 's3cr3t'}})) + return self.url_result(smuggle_url( + media_url + '?mbr=true&format=smil&sig=' + pdk_signature, {'force_smil_url': True})) diff --git a/youtube_dl/extractor/theplatform.py b/youtube_dl/extractor/theplatform.py index 0bf6726b5..10f2cad55 100644 --- a/youtube_dl/extractor/theplatform.py +++ b/youtube_dl/extractor/theplatform.py @@ -85,7 +85,7 @@ class ThePlatformBaseIE(InfoExtractor): class ThePlatformIE(ThePlatformBaseIE): _VALID_URL = r'''(?x) (?:https?://(?:link|player)\.theplatform\.com/[sp]/(?P<provider_id>[^/]+)/ - (?:(?P<media>(?:[^/]+/)+select/media/)|(?P<config>(?:[^/\?]+/(?:swf|config)|onsite)/select/))? + (?:(?P<media>(?:(?:[^/]+/)+select/)?media/)|(?P<config>(?:[^/\?]+/(?:swf|config)|onsite)/select/))? |theplatform:)(?P<id>[^/\?&]+)''' _TESTS = [{ |