File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 1111 from ordereddict import OrderedDict
1212
1313from itertools import zip_longest
14+ from types import GeneratorType
15+
1416from domaintools_async import AsyncResults as Results
1517
1618
@@ -141,3 +143,21 @@ def flattened(self):
141143 flat [f"contact_{ contact_key } _{ i } " ] = " | " .join (contact_value ) if type (contact_value ) in (list , tuple ) else contact_value
142144
143145 return flat
146+
147+
148+ class FeedsResults (Results ):
149+ """Returns the generator for feeds results"""
150+
151+ def response (self ) -> GeneratorType :
152+ status_code = None
153+ while status_code != 200 :
154+ resp_data = super ().response ()
155+ status_code = self .status
156+ yield resp_data
157+
158+ self ._data = None
159+ self ._response = None
160+ if not self .kwargs .get ("sessionID" ):
161+ # we'll only do iterative request for queries that has sessionID.
162+ # Otherwise, we will have an infinite request if sessionID was not provided but the required data asked is more than the maximum (1 hour of data)
163+ break
You can’t perform that action at this time.
0 commit comments