aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/extractor/nbc.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-05-04 21:53:05 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-05-04 21:55:04 +0800
commit0fe2ff78e68ec03d56bf3d9434eb612ffb683977 (patch)
tree4c30fd7db4745184c45cadc0059423215937cbed /youtube_dl/extractor/nbc.py
parentdc1eed93be7ac2afb3f52237ae0034d24715b4bd (diff)
downloadyoutube-dl-0fe2ff78e68ec03d56bf3d9434eb612ffb683977.zip
youtube-dl-0fe2ff78e68ec03d56bf3d9434eb612ffb683977.tar.gz
youtube-dl-0fe2ff78e68ec03d56bf3d9434eb612ffb683977.tar.bz2
[NBC] Enhance embedURL extraction (closes #2549)
Diffstat (limited to 'youtube_dl/extractor/nbc.py')
-rw-r--r--youtube_dl/extractor/nbc.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/youtube_dl/extractor/nbc.py b/youtube_dl/extractor/nbc.py
index 6cbe03d..dc2091b 100644
--- a/youtube_dl/extractor/nbc.py
+++ b/youtube_dl/extractor/nbc.py
@@ -10,6 +10,8 @@ from ..compat import (
from ..utils import (
ExtractorError,
find_xpath_attr,
+ lowercase_escape,
+ unescapeHTML,
)
@@ -46,18 +48,23 @@ class NBCIE(InfoExtractor):
'description': 'md5:0b40f9cbde5b671a7ff62fceccc4f442',
},
'skip': 'Only works from US',
+ },
+ {
+ # This video has expired but with an escaped embedURL
+ 'url': 'http://www.nbc.com/parenthood/episode-guide/season-5/just-like-at-home/515',
+ 'skip': 'Expired'
}
]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
- theplatform_url = self._search_regex(
+ theplatform_url = unescapeHTML(lowercase_escape(self._html_search_regex(
[
r'(?:class="video-player video-player-full" data-mpx-url|class="player" src)="(.*?)"',
r'"embedURL"\s*:\s*"([^"]+)"'
],
- webpage, 'theplatform url').replace('_no_endcard', '')
+ webpage, 'theplatform url').replace('_no_endcard', '').replace('\\/', '/')))
if theplatform_url.startswith('//'):
theplatform_url = 'http:' + theplatform_url
return self.url_result(theplatform_url)