]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/c56.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
9 class C56IE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:(?:www|player)\.)?56\.com/(?:.+?/)?(?:v_|(?:play_album.+-))(?P<textid>.+?)\.(?:html|swf)'
13 'url': 'http://www.56.com/u39/v_OTM0NDA3MTY.html',
14 'md5': 'e59995ac63d0457783ea05f93f12a866',
18 'title': '网事知多少 第32期:车怒',
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
, flags
=re
.VERBOSE
)
25 text_id
= mobj
.group('textid')
27 page
= self
._download
_json
(
28 'http://vxml.56.com/json/%s/' % text_id
, text_id
, 'Downloading video info')
34 'format_id': f
['type'],
35 'filesize': int(f
['filesize']),
37 } for f
in info
['rfiles']
39 self
._sort
_formats
(formats
)
43 'title': info
['Subject'],
44 'duration': int(info
['duration']) / 1000.0,
46 'thumbnail': info
.get('bimg') or info
.get('img'),