1 from .common
import InfoExtractor
9 class MeipaiIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://(?:www\.)?meipai\.com/media/(?P<id>[0-9]+)'
13 # regular uploaded video
14 'url': 'http://www.meipai.com/media/531697625',
15 'md5': 'e3e9600f9e55a302daecc90825854b4f',
19 'title': '#葉子##阿桑##余姿昀##超級女聲#',
20 'description': '#葉子##阿桑##余姿昀##超級女聲#',
21 'thumbnail': r
're:^https?://.*\.jpg$',
23 'timestamp': 1465492420,
24 'upload_date': '20160609',
27 'tags': ['葉子', '阿桑', '余姿昀', '超級女聲'],
30 # record of live streaming
31 'url': 'http://www.meipai.com/media/585526361',
32 'md5': 'ff7d6afdbc6143342408223d4f5fb99a',
36 'title': '姿昀和善願 練歌練琴啦😁😁😁',
37 'description': '姿昀和善願 練歌練琴啦😁😁😁',
38 'thumbnail': r
're:^https?://.*\.jpg$',
40 'timestamp': 1474311799,
41 'upload_date': '20160919',
47 def _real_extract(self
, url
):
48 video_id
= self
._match
_id
(url
)
49 webpage
= self
._download
_webpage
(url
, video_id
)
51 title
= self
._generic
_title
('', webpage
)
55 # recorded playback of live streaming
56 m3u8_url
= self
._html
_search
_regex
(
57 r
'file:\s*encodeURIComponent\((["\'])(?P
<url
>(?
:(?
!\
1).)+)\
1\
)',
58 webpage, 'm3u8 url
', group='url
', default=None)
60 formats.extend(self._extract_m3u8_formats(
61 m3u8_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
62 m3u8_id='hls
', fatal=False))
65 # regular uploaded video
66 video_url = self._search_regex(
67 r'data
-video
=(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'video url',
68 group='url', default=None)
75 timestamp = unified_timestamp(self._og_search_property(
76 'video:release_date', webpage, 'release date', fatal=False))
78 tags = self._og_search_property(
79 'video:tag', webpage, 'tags', default='').split(',')
81 view_count = int_or_none(self._html_search_meta(
82 'interactionCount', webpage, 'view count'))
83 duration = parse_duration(self._html_search_meta(
84 'duration', webpage, 'duration'))
85 creator = self._og_search_property(
86 'video:director', webpage, 'creator', fatal=False)
91 'description': self._og_search_description(webpage),
92 'thumbnail': self._og_search_thumbnail(webpage),
94 'timestamp': timestamp,
95 'view_count': view_count,