parent
03501edccd
commit
e518f2cced
3
morss.py
3
morss.py
|
@ -15,6 +15,7 @@ import lxml.html.clean
|
||||||
import lxml.builder
|
import lxml.builder
|
||||||
|
|
||||||
import urllib2
|
import urllib2
|
||||||
|
import socket
|
||||||
from cookielib import CookieJar
|
from cookielib import CookieJar
|
||||||
import chardet
|
import chardet
|
||||||
|
|
||||||
|
@ -283,7 +284,7 @@ def EncDownload(url):
|
||||||
opener.addheaders = [('User-Agent', UA_HML)]
|
opener.addheaders = [('User-Agent', UA_HML)]
|
||||||
con = opener.open(url, timeout=TIMEOUT)
|
con = opener.open(url, timeout=TIMEOUT)
|
||||||
data = con.read()
|
data = con.read()
|
||||||
except (urllib2.HTTPError, urllib2.URLError) as error:
|
except (urllib2.HTTPError, urllib2.URLError, socket.timeout) as error:
|
||||||
log(error)
|
log(error)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue