X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fstreamcloud.py;h=77841b94686a27feb00968e5f3b67729504cee6c;hb=5c2266df4b9aeb7881ed8c026a038e2a25e43734;hp=172def221e1277298dc355a2cfdbea3ae4f9fdce;hpb=d5638d974f93d62043c0509ed6a04359e1cd9c46;p=youtube-dl diff --git a/youtube_dl/extractor/streamcloud.py b/youtube_dl/extractor/streamcloud.py index 172def221..77841b946 100644 --- a/youtube_dl/extractor/streamcloud.py +++ b/youtube_dl/extractor/streamcloud.py @@ -2,18 +2,15 @@ from __future__ import unicode_literals import re -import time from .common import InfoExtractor -from ..utils import ( - compat_urllib_parse, - compat_urllib_request, -) +from ..compat import compat_urllib_parse +from ..utils import sanitized_Request class StreamcloudIE(InfoExtractor): IE_NAME = 'streamcloud.eu' - _VALID_URL = r'https?://streamcloud\.eu/(?P[a-zA-Z0-9_-]+)/(?P[^#?]*)\.html' + _VALID_URL = r'https?://streamcloud\.eu/(?P[a-zA-Z0-9_-]+)(?:/(?P[^#?]*)\.html)?' _TEST = { 'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html', @@ -27,8 +24,8 @@ class StreamcloudIE(InfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + video_id = self._match_id(url) + url = 'http://streamcloud.eu/%s' % video_id orig_webpage = self._download_webpage(url, video_id) @@ -40,12 +37,11 @@ class StreamcloudIE(InfoExtractor): ''', orig_webpage) post = compat_urllib_parse.urlencode(fields) - self.to_screen('%s: Waiting for timeout' % video_id) - time.sleep(12) + self._sleep(12, video_id) headers = { b'Content-Type': b'application/x-www-form-urlencoded', } - req = compat_urllib_request.Request(url, post, headers) + req = sanitized_Request(url, post, headers) webpage = self._download_webpage( req, video_id, note='Downloading video page ...')