1 from .common
import InfoExtractor
8 class HuajiaoIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?huajiao\.com/l/(?P<id>[0-9]+)'
12 'url': 'http://www.huajiao.com/l/38941232',
13 'md5': 'd08bf9ac98787d24d1e4c0283f2d372d',
18 'description': 're:.*',
20 'thumbnail': r
're:^https?://.*\.jpg$',
21 'timestamp': 1475866459,
22 'upload_date': '20161007',
23 'uploader': 'Penny_余姿昀',
24 'uploader_id': '75206005',
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(url
, video_id
)
32 feed_json
= self
._search
_regex
(
33 r
'var\s+feed\s*=\s*({.+})', webpage
, 'feed json')
34 feed
= self
._parse
_json
(feed_json
, video_id
)
36 description
= self
._html
_search
_meta
(
37 'description', webpage
, 'description', fatal
=False)
39 def get(section
, field
):
40 return feed
.get(section
, {}).get(field
)
44 'title': feed
['feed']['formated_title'],
45 'description': description
,
46 'duration': parse_duration(get('feed', 'duration')),
47 'thumbnail': get('feed', 'image'),
48 'timestamp': parse_iso8601(feed
.get('creatime'), ' '),
49 'uploader': get('author', 'nickname'),
50 'uploader_id': get('author', 'uid'),
51 'formats': self
._extract
_m
3u8_formats
(
52 feed
['feed']['m3u8'], video_id
, 'mp4', 'm3u8_native'),