1 from .common
import InfoExtractor
4 class TelewebionIE(InfoExtractor
):
5 _VALID_URL
= r
'https?://(?:www\.)?telewebion\.com/#!/episode/(?P<id>\d+)'
8 'url': 'http://www.telewebion.com/#!/episode/1263668/',
12 'title': 'قرعه\u200cکشی لیگ قهرمانان اروپا',
13 'thumbnail': r
're:^https?://.*\.jpg',
18 'skip_download': True,
22 def _real_extract(self
, url
):
23 video_id
= self
._match
_id
(url
)
25 secure_token
= self
._download
_webpage
(
26 'http://m.s2.telewebion.com/op/op?action=getSecurityToken', video_id
)
27 episode_details
= self
._download
_json
(
28 'http://m.s2.telewebion.com/op/op', video_id
,
29 query
={'action': 'getEpisodeDetails', 'episode_id': video_id}
)
31 m3u8_url
= 'http://m.s1.telewebion.com/smil/%s.m3u8?filepath=%s&m3u8=1&secure_token=%s' % (
32 video_id
, episode_details
['file_path'], secure_token
)
33 formats
= self
._extract
_m
3u8_formats
(
34 m3u8_url
, video_id
, ext
='mp4', m3u8_id
='hls')
37 episode_details
.get('picture_path'),
38 episode_details
.get('large_picture_path'),
44 } for idx
, picture_path
in enumerate(picture_paths
) if picture_path
is not None]
48 'title': episode_details
['title'],
50 'thumbnails': thumbnails
,
51 'view_count': episode_details
.get('view_count'),