|
15 | 15 | import urlparse |
16 | 16 | import traceback |
17 | 17 |
|
| 18 | +from extra.socks.socks import GeneralProxyError |
18 | 19 | from extra.multipart import multipartpost |
| 20 | + |
19 | 21 | from lib.core.agent import agent |
20 | 22 | from lib.core.common import asciifyUrl |
21 | 23 | from lib.core.common import average |
@@ -92,10 +94,20 @@ def __retryProxy(**kwargs): |
92 | 94 | warnMsg += "lower the --time-sec value (e.g. --time-sec=2)" |
93 | 95 | singleTimeWarnMessage(warnMsg) |
94 | 96 | elif kb.originalPage is None: |
95 | | - warnMsg = "if the problem persists please check that the provided " |
96 | | - warnMsg += "target url is valid. If it is, you can try to rerun " |
97 | | - warnMsg += "with the --random-agent switch turned on " |
98 | | - warnMsg += "and/or proxy switches (--ignore-proxy, --proxy,...)" |
| 97 | + if conf.tor: |
| 98 | + warnMsg = "please make sure that you have " |
| 99 | + warnMsg += "Tor installed and running so " |
| 100 | + warnMsg += "you could successfully use " |
| 101 | + warnMsg += "--tor switch " |
| 102 | + if IS_WIN: |
| 103 | + warnMsg += "(e.g. https://www.torproject.org/download/download.html.en)" |
| 104 | + else: |
| 105 | + warnMsg += "(e.g. https://help.ubuntu.com/community/Tor)" |
| 106 | + else: |
| 107 | + warnMsg = "if the problem persists please check that the provided " |
| 108 | + warnMsg += "target url is valid. If it is, you can try to rerun " |
| 109 | + warnMsg += "with the --random-agent switch turned on " |
| 110 | + warnMsg += "and/or proxy switches (--ignore-proxy, --proxy,...)" |
99 | 111 | singleTimeWarnMessage(warnMsg) |
100 | 112 | elif conf.threads > 1: |
101 | 113 | warnMsg = "if the problem persists please try to lower " |
@@ -440,7 +452,7 @@ def getPage(**kwargs): |
440 | 452 | processResponse(page, responseHeaders) |
441 | 453 | return page, responseHeaders, code |
442 | 454 |
|
443 | | - except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead), e: |
| 455 | + except (urllib2.URLError, socket.error, socket.timeout, httplib.BadStatusLine, httplib.IncompleteRead, GeneralProxyError), e: |
444 | 456 | tbMsg = traceback.format_exc() |
445 | 457 |
|
446 | 458 | if "no host given" in tbMsg: |
|
0 commit comments