Update 3.9.2
This commit is contained in:
@@ -66,6 +66,9 @@ def get_html(url, cookies: dict = None, ua: str = None, return_type: str = None)
|
|||||||
print("[-]Connect retry {}/{}".format(i + 1, retry_count))
|
print("[-]Connect retry {}/{}".format(i + 1, retry_count))
|
||||||
except requests.exceptions.ConnectionError:
|
except requests.exceptions.ConnectionError:
|
||||||
print("[-]Connect retry {}/{}".format(i + 1, retry_count))
|
print("[-]Connect retry {}/{}".format(i + 1, retry_count))
|
||||||
|
except Exception as e:
|
||||||
|
print("[-]Connect retry {}/{}".format(i + 1, retry_count))
|
||||||
|
print("[-]" + str(e))
|
||||||
print('[-]Connect Failed! Please check your Proxy or Network!')
|
print('[-]Connect Failed! Please check your Proxy or Network!')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
10
config.py
10
config.py
@@ -12,7 +12,15 @@ class Config:
|
|||||||
except:
|
except:
|
||||||
self.conf.read(path, encoding="utf-8")
|
self.conf.read(path, encoding="utf-8")
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
|
self.conf = configparser.ConfigParser()
|
||||||
|
try: # From single crawler debug use only
|
||||||
|
self.conf.read('../' + path, encoding="utf-8-sig")
|
||||||
|
except:
|
||||||
|
self.conf.read('../' + path, encoding="utf-8")
|
||||||
|
except Exception as e:
|
||||||
print("[-]Config file not found! Use the default settings")
|
print("[-]Config file not found! Use the default settings")
|
||||||
|
print("[-]",e)
|
||||||
self.conf = self._default_config()
|
self.conf = self._default_config()
|
||||||
|
|
||||||
def main_mode(self) -> str:
|
def main_mode(self) -> str:
|
||||||
@@ -103,7 +111,7 @@ class Config:
|
|||||||
sec2 = "proxy"
|
sec2 = "proxy"
|
||||||
conf.add_section(sec2)
|
conf.add_section(sec2)
|
||||||
conf.set(sec2, "proxy", "")
|
conf.set(sec2, "proxy", "")
|
||||||
conf.set(sec2, "timeout", "10")
|
conf.set(sec2, "timeout", "5")
|
||||||
conf.set(sec2, "retry", "3")
|
conf.set(sec2, "retry", "3")
|
||||||
conf.set(sec2, "type", "socks5")
|
conf.set(sec2, "type", "socks5")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user