aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-12-28 10:27:17 +0100
committerremitamine <remitamine@gmail.com>2015-12-28 10:27:17 +0100
commitbca9bea1c1a13d2f9ad3244a2b11979220c30484 (patch)
treee212f929483240f659850c2e71589615e45b172f /youtube_dl
parent6afe044b51e99a3a0e638492e118634a2ca3cdad (diff)
[dcn] make m3u8 formats extraction non fatal
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/dcn.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/youtube_dl/extractor/dcn.py b/youtube_dl/extractor/dcn.py
index 3857ba334..d9485cd86 100644
--- a/youtube_dl/extractor/dcn.py
+++ b/youtube_dl/extractor/dcn.py
@@ -54,10 +54,14 @@ class DCNBaseIE(InfoExtractor):
}
def _extract_video_formats(self, webpage, video_id, entry_protocol):
+ formats = []
m3u8_url = self._html_search_regex(
- r'file\s*:\s*"([^"]+)', webpage, 'm3u8 url')
- formats = self._extract_m3u8_formats(
- m3u8_url, video_id, 'mp4', entry_protocol, m3u8_id='hls')
+ r'file\s*:\s*"([^"]+)', webpage, 'm3u8 url', fatal=False)
+ if m3u8_url:
+ m3u8_formats = self._extract_m3u8_formats(
+ m3u8_url, video_id, 'mp4', entry_protocol, m3u8_id='hls', fatal=None)
+ if m3u8_formats:
+ formats.extend(m3u8_formats)
rtsp_url = self._search_regex(
r'<a[^>]+href="(rtsp://[^"]+)"', webpage, 'rtsp url', fatal=False)
@@ -117,21 +121,6 @@ class DCNVideoIE(DCNBaseIE):
class DCNLiveIE(DCNBaseIE):
IE_NAME = 'dcn:live'
_VALID_URL = r'https?://(?:www\.)?dcndigital\.ae/(?:#/)?live/(?P<id>\d+)'
- _TEST = {
- 'url': 'http://www.dcndigital.ae/#/live/6/dubai-tv',
- 'info_dict':
- {
- 'id': '6',
- 'ext': 'mp4',
- 'title': 're:^Dubai Al Oula [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
- 'thumbnail': 're:^https?://.*\.png$',
- 'is_live': True,
- },
- 'params': {
- # m3u8 download
- 'skip_download': True,
- },
- }
def _real_extract(self, url):
channel_id = self._match_id(url)