2 from __future__ import unicode_literals
7 from .common import InfoExtractor
10 compat_urllib_request,
14 class StreamcloudIE(InfoExtractor):
15 IE_NAME = 'streamcloud.eu'
16 _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?P<fname>[^#?]*)\.html)?'
19 'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html',
20 'md5': '6bea4c7fa5daaacc2a946b7146286686',
24 'title': 'youtube-dl test video \'/\\ ä ↭',
26 'skip': 'Only available from the EU'
29 def _real_extract(self, url):
30 video_id = self._match_id(url)
31 url = 'http://streamcloud.eu/%s' % video_id
33 orig_webpage = self._download_webpage(url, video_id)
35 fields = re.findall(r'''(?x)<input\s+
36 type="(?:hidden|submit)"\s+
41 post = compat_urllib_parse.urlencode(fields)
43 self._sleep(12, video_id)
45 b'Content-Type': b'application/x-www-form-urlencoded',
47 req = compat_urllib_request.Request(url, post, headers)
49 webpage = self._download_webpage(
50 req, video_id, note='Downloading video page ...')
51 title = self._html_search_regex(
52 r'<h1[^>]*>([^<]+)<', webpage, 'title')
53 video_url = self._search_regex(
54 r'file:\s*"([^"]+)"', webpage, 'video URL')
55 thumbnail = self._search_regex(
56 r'image:\s*"([^"]+)"', webpage, 'thumbnail URL', fatal=False)
62 'thumbnail': thumbnail,