]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/vodlocker.py
1 # -*- coding: utf-8 -*-
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
11 class VodlockerIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?vodlocker\.com/(?P<id>[0-9a-zA-Z]+)(?:\..*?)?'
15 'url': 'http://vodlocker.com/e8wvyzz4sl42',
16 'md5': 'ce0c2d18fa0735f1bd91b69b0e54aacf',
20 'title': 'Germany vs Brazil',
21 'thumbnail': 're:http://.*\.jpg',
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
27 webpage
= self
._download
_webpage
(url
, video_id
)
29 fields
= self
._hidden
_inputs
(webpage
)
31 if fields
['op'] == 'download1':
32 self
._sleep
(3, video_id
) # they do detect when requests happen too fast!
33 post
= compat_urllib_parse
.urlencode(fields
)
34 req
= compat_urllib_request
.Request(url
, post
)
35 req
.add_header('Content-type', 'application/x-www-form-urlencoded')
36 webpage
= self
._download
_webpage
(
37 req
, video_id
, 'Downloading video page')
39 title
= self
._search
_regex
(
40 r
'id="file_title".*?>\s*(.*?)\s*<(?:br|span)', webpage
, 'title')
41 thumbnail
= self
._search
_regex
(
42 r
'image:\s*"(http[^\"]+)",', webpage
, 'thumbnail')
43 url
= self
._search
_regex
(
44 r
'file:\s*"(http[^\"]+)",', webpage
, 'file url')
54 'thumbnail': thumbnail
,