Closed maitray16 closed 5 years ago
Similar problem on OSX:
print(otx.getall())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/OTXv2.py", line 273, in getall
json_data = self.get(next_page_url)
File "/usr/local/lib/python3.7/site-packages/OTXv2.py", line 83, in get
data = response.read().decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'read'
I am getting the same.
Starting OTX feed download ...
Traceback (most recent call last):
File "get-otx-iocs.py", line 297, in
Hi,
I'm looking into this.
Can you confirm if you're using the latest version from Github, or the slightly older version from pip?
Many thanks,
Hi,
I'm looking into this.
Can you confirm if you're using the latest version from Github, or the slightly older version from pip?
Many thanks,
Sorry, if this is regarding the cli-example, I also tried that one. Was not getting any errors but nothing was happening when I ran it. Not using python 3.
Thanks coppolak.
We've recently had some large increases in API usage that were impacting performance, and have started limiting requests to getall() without "modified_since" set to one every two hours. Apologies for not documenting that in the SDK.
We're updating the API later today to make that less strict so your script may start working after that.
In the short term, adding modified_since should make the calls work.
For example:
print(otx.getall())
Becomes:
three_months_dt = (datetime.datetime.now() - datetime.timedelta(days=1))
print(otx.getall(modified_since=three_months_dt))
In the longer term - we're looking at a few options to do this better and I will update here.
Thanks coppolak.
We've recently had some large increases in API usage that were impacting performance, and have started limiting requests to getall() without "modified_since" set to one every two hours. Apologies for not documenting that in the SDK.
We're updating the API later today to make that less strict so your script may start working after that.
In the short term, adding modified_since should make the calls work.
For example:
print(otx.getall())
Becomes:
three_months_dt = (datetime.datetime.now() - datetime.timedelta(days=1)) print(otx.getall(modified_since=three_months_dt))
In the longer term - we're looking at a few options to do this better and I will update here.
Thank you for letting me know. I tried what you said:
if args["subscribed"]:
three_months_dt=(datetime.datetime.now() - datetime.timedelta(days=90))
print (str(otx.getall(modified_since=three_months_dt)))
And I am still not having any luck. No error, but still nothing happening.
Hi @maitray16 - are you still getting the same error please?
Your issue is slightly different to the other reported here.
Hi @coppolak
Can I confirm the command you're running please? Eg; python cli_example.py -s or python cli_example.py --subscribed
Is your user subscribed to any users?
Thanks,
Hey @chrisdoman - Let me test it out. Currently switched to using requests and fetching different sections when needed, seems to be working fine. Will test it out with the original script and let you know.
Hi @chrisdoman I am now getting the error getall() got an unexpected keyword argument 'modified_since'
@chrisdoman I ran it through a list of few 100 IPs, haven't noticed an issue or NoneType errors, seems to be working fine.
Hi @coppolak - try downloading the latest version of the repository and installing it, i.e. python setup.py install
Hi @chrisdoman I have the latest version
@chrisdoman the issue has been resolved. However, whenever I run the script with any arugments other than --subscribed, I get error: error:argument -d/--domain:expected one argument. What am I missing?
@coppolak are you providing a domain to check? eg; python cli_example.py --domain google.com
I'll close this ticket as it seems the original issue is fixed, but feel free to open a new one.
When looping through IP's using the otx.get_indicator_details_full function, I get an error - AttributeError: 'NoneType' object has no attribute 'read'.
Using Python Version - 3.6.4