]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vimple.py
aa3d6ddfd2420524fd87f85819d2611225224e79
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from ..utils
import int_or_none
7 class VimpleIE(InfoExtractor
):
8 IE_DESC
= 'Vimple - one-click video hosting'
9 _VALID_URL
= r
'https?://(?:player\.vimple\.ru/iframe|vimple\.ru)/(?P<id>[\da-f-]{32,36})'
12 'url': 'http://vimple.ru/c0f6b1687dcd4000a97ebe70068039cf',
13 'md5': '2e750a330ed211d3fd41821c6ad9a279',
15 'id': 'c0f6b168-7dcd-4000-a97e-be70068039cf',
19 'thumbnail': 're:https?://.*?\.jpg',
22 'url': 'http://player.vimple.ru/iframe/52e1beec-1314-4a83-aeac-c61562eadbf9',
23 'only_matching': True,
27 def _real_extract(self
, url
):
28 video_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(
31 'http://player.vimple.ru/iframe/%s' % video_id
, video_id
)
33 playlist
= self
._parse
_json
(
35 r
'sprutoData\s*:\s*({.+?}),\r\n', webpage
, 'spruto data'),
36 video_id
)['playlist'][0]
38 title
= playlist
['title']
39 video_id
= playlist
.get('videoId') or video_id
40 thumbnail
= playlist
.get('posterUrl') or playlist
.get('thumbnailUrl')
41 duration
= int_or_none(playlist
.get('duration'))
45 } for f
in playlist
['video']]
46 self
._sort
_formats
(formats
)
51 'thumbnail': thumbnail
,