projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[canal+] Add support for d17.tv
[youtube-dl]
/
youtube_dl
/
extractor
/
streamcloud.py
diff --git
a/youtube_dl/extractor/streamcloud.py
b/youtube_dl/extractor/streamcloud.py
index 172def221e1277298dc355a2cfdbea3ae4f9fdce..712359885fde90fa3032aeff1b2cb74afb761f35 100644
(file)
--- a/
youtube_dl/extractor/streamcloud.py
+++ b/
youtube_dl/extractor/streamcloud.py
@@
-2,18
+2,17
@@
from __future__ import unicode_literals
import re
from __future__ import unicode_literals
import re
-import time
from .common import InfoExtractor
from ..utils import (
from .common import InfoExtractor
from ..utils import (
-
compat_urllib_parse
,
-
compat_urllib_request
,
+
sanitized_Request
,
+
urlencode_postdata
,
)
class StreamcloudIE(InfoExtractor):
IE_NAME = 'streamcloud.eu'
)
class StreamcloudIE(InfoExtractor):
IE_NAME = 'streamcloud.eu'
- _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)
/(?P<fname>[^#?]*)\.html
'
+ _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)
(?:/(?P<fname>[^#?]*)\.html)?
'
_TEST = {
'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html',
_TEST = {
'url': 'http://streamcloud.eu/skp9j99s4bpz/youtube-dl_test_video_____________-BaW_jenozKc.mp4.html',
@@
-27,8
+26,8
@@
class StreamcloudIE(InfoExtractor):
}
def _real_extract(self, url):
}
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)
orig_webpage = self._download_webpage(url, video_id)
@@
-38,14
+37,13
@@
class StreamcloudIE(InfoExtractor):
(?:id="[^"]+"\s+)?
value="([^"]*)"
''', orig_webpage)
(?:id="[^"]+"\s+)?
value="([^"]*)"
''', orig_webpage)
- post =
compat_urllib_parse.urlencode
(fields)
+ post =
urlencode_postdata
(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',
}
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 ...')
webpage = self._download_webpage(
req, video_id, note='Downloading video page ...')