diff options
author | Jinwei Zhao <[email protected]> | 2017-01-31 08:35:05 +0800 |
---|---|---|
committer | Jinwei Zhao <[email protected]> | 2017-01-31 08:35:05 +0800 |
commit | 66d411c97ba82bfe3b072b57d2b7f8a6554723d6 (patch) | |
tree | baa314fc017e84e2aa5d39ca9ee0922e79957e07 /ingrex/intel.py | |
parent | 8a1af78b809716a471d1c0d12cfcf89d2e19070f (diff) | |
download | COMM2TG-66d411c97ba82bfe3b072b57d2b7f8a6554723d6.tar.gz |
format
Diffstat (limited to 'ingrex/intel.py')
-rwxr-xr-x | ingrex/intel.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ingrex/intel.py b/ingrex/intel.py index f13b2a2..506c6bc 100755 --- a/ingrex/intel.py +++ b/ingrex/intel.py | |||
@@ -2,7 +2,7 @@ | |||
2 | import requests | 2 | import requests |
3 | import re | 3 | import re |
4 | import json | 4 | import json |
5 | import os | 5 | |
6 | 6 | ||
7 | class Intel(object): | 7 | class Intel(object): |
8 | "main class with all Intel functions" | 8 | "main class with all Intel functions" |
@@ -43,7 +43,7 @@ class Intel(object): | |||
43 | count = 0 | 43 | count = 0 |
44 | while count < 3: | 44 | while count < 3: |
45 | try: | 45 | try: |
46 | request = self.session.post(url, data=json.dumps(payload), headers=self.headers) | 46 | request = self.session.post(url, data=json.dumps(payload), headers=self.headers, timeout=600) |
47 | return request.json()['result'] | 47 | return request.json()['result'] |
48 | except requests.ConnectionError: | 48 | except requests.ConnectionError: |
49 | raise IntelError | 49 | raise IntelError |
@@ -132,10 +132,12 @@ class Intel(object): | |||
132 | } | 132 | } |
133 | return self.fetch(url, payload) | 133 | return self.fetch(url, payload) |
134 | 134 | ||
135 | |||
135 | class IntelError(BaseException): | 136 | class IntelError(BaseException): |
136 | """Intel Error""" | 137 | """Intel Error""" |
137 | pass | 138 | pass |
138 | 139 | ||
140 | |||
139 | class CookieError(IntelError): | 141 | class CookieError(IntelError): |
140 | """Intel Error""" | 142 | """Intel Error""" |
141 | pass | 143 | pass |