Remove the calls to 'compat_urllib_request.urlopen' in a few extractors

This commit is contained in:
Jaime Marquínez Ferrándiz
2013-12-08 22:24:55 +01:00
parent ac5118bcb9
commit baa7b1978b
5 changed files with 42 additions and 86 deletions

View File

@ -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