]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ruhd.py
55b58e5e6c09af2d211edaba256ad2ebce2a958d
1 # -*- coding: utf-8 -*-
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
9 class RUHDIE(InfoExtractor
):
10 _VALID_URL
= r
'http://(?:www\.)?ruhd\.ru/play\.php\?vid=(?P<id>\d+)'
12 'url': 'http://www.ruhd.ru/play.php?vid=207',
13 'md5': 'd1a9ec4edf8598e3fbd92bb16072ba83',
17 'title': 'КОТ бааааам',
18 'description': 'классный кот)',
19 'thumbnail': 're:^http://.*\.jpg$',
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
25 video_id
= mobj
.group('id')
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 video_url
= self
._html
_search
_regex
(
30 r
'<param name="src" value="([^"]+)"', webpage
, 'video url')
31 title
= self
._html
_search
_regex
(
32 r
'<title>([^<]+) RUHD.ru - Видео Высокого качества №1 в России!</title>', webpage
, 'title')
33 description
= self
._html
_search
_regex
(
34 r
'(?s)<div id="longdesc">(.+?)<span id="showlink">', webpage
, 'description', fatal
=False)
35 thumbnail
= self
._html
_search
_regex
(
36 r
'<param name="previewImage" value="([^"]+)"', webpage
, 'thumbnail', fatal
=False)
38 thumbnail
= 'http://www.ruhd.ru' + thumbnail
44 'description': description
,
45 'thumbnail': thumbnail
,