]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/dcn.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..compat
import compat_urllib_parse
13 class DCNIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://(?:www\.)?dcndigital\.ae/(?:#/)?(?:video/.+|show/\d+/.+?)/(?P<id>\d+)'
16 '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',
21 'title': 'رحلة العمر : الحلقة 1',
22 'description': 'md5:0156e935d870acb8ef0a66d24070c6d6',
23 'thumbnail': 're:^https?://.*\.jpg$',
25 'timestamp': 1227504126,
26 'upload_date': '20081124',
30 'skip_download': True,
34 def _real_extract(self
, url
):
35 video_id
= self
._match
_id
(url
)
37 request
= sanitized_Request(
38 'http://admin.mangomolo.com/analytics/index.php/plus/video?id=%s' % video_id
,
39 headers
={'Origin': 'http://www.dcndigital.ae'})
41 video
= self
._download
_json
(request
, video_id
)
42 title
= video
.get('title_en') or video
['title_ar']
44 webpage
= self
._download
_webpage
(
45 'http://admin.mangomolo.com/analytics/index.php/customers/embed/video?' +
46 compat_urllib_parse
.urlencode({
48 'user_id': video
['user_id'],
49 'signature': video
['signature'],
54 m3u8_url
= self
._html
_search
_regex
(r
'file:\s*"([^"]+)', webpage
, 'm3u8 url')
55 formats
= self
._extract
_m
3u8_formats
(
56 m3u8_url
, video_id
, 'mp4', entry_protocol
='m3u8_native', m3u8_id
='hls')
58 rtsp_url
= self
._search
_regex
(
59 r
'<a[^>]+href="(rtsp://[^"]+)"', webpage
, 'rtsp url', fatal
=False)
66 self
._sort
_formats
(formats
)
68 img
= video
.get('img')
69 thumbnail
= 'http://admin.mangomolo.com/analytics/%s' % img
if img
else None
70 duration
= int_or_none(video
.get('duration'))
71 description
= video
.get('description_en') or video
.get('description_ar')
72 timestamp
= parse_iso8601(video
.get('create_time') or video
.get('update_time'), ' ')
77 'description': description
,
78 'thumbnail': thumbnail
,
80 'timestamp': timestamp
,