]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/streamcloud.py
3 from .common
import InfoExtractor
10 class StreamcloudIE(InfoExtractor
):
11 IE_NAME
= 'streamcloud.eu'
12 _VALID_URL
= r
'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?P<fname>[^#?]*)\.html)?'
15 'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html',
16 'md5': '6bea4c7fa5daaacc2a946b7146286686',
20 'title': 'youtube-dl test video \'/\\ ä ↭',
22 'skip': 'Only available from the EU'
24 'url': 'http://streamcloud.eu/ua8cmfh1nbe6/NSHIP-148--KUC-NG--H264-.mp4.html',
25 'only_matching': True,
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
30 url
= 'http://streamcloud.eu/%s' % video_id
32 orig_webpage
= self
._download
_webpage
(url
, video_id
)
34 if '>File Not Found<' in orig_webpage
:
36 'Video %s does not exist' % video_id
, expected
=True)
38 fields
= re
.findall(r
'''(?x)<input\s+
39 type="(?:hidden|submit)"\s+
45 self
._sleep
(6, video_id
)
47 webpage
= self
._download
_webpage
(
48 url
, video_id
, data
=urlencode_postdata(fields
), headers
={
49 b
'Content-Type': b
'application/x-www-form-urlencoded',
53 title
= self
._html
_search
_regex
(
54 r
'<h1[^>]*>([^<]+)<', webpage
, 'title')
55 video_url
= self
._search
_regex
(
56 r
'file:\s*"([^"]+)"', webpage
, 'video URL')
57 except ExtractorError
:
58 message
= self
._html
_search
_regex
(
59 r
'(?s)<div[^>]+class=(["\']).*?msgboxinfo
.*?\
1[^
>]*>(?P
<message
>.+?
)</div
>',
60 webpage, 'message
', default=None, group='message
')
62 raise ExtractorError('%s said
: %s' % (self.IE_NAME, message), expected=True)
64 thumbnail = self._search_regex(
65 r'image
:\s
*"([^"]+)"', webpage, 'thumbnail URL', fatal=False)
71 'thumbnail': thumbnail,