aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/mixcloud.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-08 22:24:55 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-08 22:24:55 +0100
commitbaa7b1978bc1d77858458c2b31aec3ff819a3e6a (patch)
tree7818c062b4423bba3e7a4f30faf58558025ab0a6 /youtube_dl/extractor/mixcloud.py
parentac5118bcb92a489eec0e9997e55e07945dc720db (diff)
Remove the calls to 'compat_urllib_request.urlopen' in a few extractors
Diffstat (limited to 'youtube_dl/extractor/mixcloud.py')
-rw-r--r--youtube_dl/extractor/mixcloud.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/youtube_dl/extractor/mixcloud.py b/youtube_dl/extractor/mixcloud.py
index e2baf44d7..04fa3ac7a 100644
--- a/youtube_dl/extractor/mixcloud.py
+++ b/youtube_dl/extractor/mixcloud.py
@@ -1,13 +1,10 @@
import json
import re
-import socket
from .common import InfoExtractor
from ..utils import (
- compat_http_client,
- compat_urllib_error,
- compat_urllib_request,
unified_strdate,
+ ExtractorError,
)
@@ -31,9 +28,11 @@ class MixcloudIE(InfoExtractor):
"""Returns 1st active url from list"""
for url in url_list:
try:
- compat_urllib_request.urlopen(url)
+ # We only want to know if the request succeed
+ # don't download the whole file
+ self._request_webpage(url, None, False)
return url
- except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error):
+ except ExtractorError:
url = None
return None