2 from __future__ import unicode_literals
4 from .common import InfoExtractor
15 class DCNIE(InfoExtractor):
16 _VALID_URL = r'https?://(?:www\.)?dcndigital\.ae/(?:#/)?(?:video/.+|show/\d+/.+?)/(?P<id>\d+)'
18 'url': 'http://www.dcndigital.ae/#/show/199074/%D8%B1%D8%AD%D9%84%D8%A9-%D8%A7%D9%84%D8%B9%D9%85%D8%B1-%D8%A7%D9%84%D8%AD%D9%84%D9%82%D8%A9-1/17375/6887',
23 'title': 'رحلة العمر : الحلقة 1',
24 'description': 'md5:0156e935d870acb8ef0a66d24070c6d6',
25 'thumbnail': 're:^https?://.*\.jpg$',
27 'timestamp': 1227504126,
28 'upload_date': '20081124',
32 'skip_download': True,
36 def _real_extract(self, url):
37 video_id = self._match_id(url)
39 request = compat_urllib_request.Request(
40 'http://admin.mangomolo.com/analytics/index.php/plus/video?id=%s' % video_id,
41 headers={'Origin': 'http://www.dcndigital.ae'})
43 video = self._download_json(request, video_id)
44 title = video.get('title_en') or video['title_ar']
46 webpage = self._download_webpage(
47 'http://admin.mangomolo.com/analytics/index.php/customers/embed/video?' +
48 compat_urllib_parse.urlencode({
50 'user_id': video['user_id'],
51 'signature': video['signature'],
56 m3u8_url = self._html_search_regex(r'file:\s*"([^"]+)', webpage, 'm3u8 url')
57 formats = self._extract_m3u8_formats(
58 m3u8_url, video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')
60 rtsp_url = self._search_regex(
61 r'<a[^>]+href="(rtsp://[^"]+)"', webpage, 'rtsp url', fatal=False)
68 self._sort_formats(formats)
70 img = video.get('img')
71 thumbnail = 'http://admin.mangomolo.com/analytics/%s' % img if img else None
72 duration = int_or_none(video.get('duration'))
73 description = video.get('description_en') or video.get('description_ar')
74 timestamp = parse_iso8601(video.get('create_time') or video.get('update_time'), ' ')
79 'description': description,
80 'thumbnail': thumbnail,
82 'timestamp': timestamp,