Comments (15)
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'
from otx-python-sdk.
I am getting the same.
Starting OTX feed download ...
Traceback (most recent call last):
File "get-otx-iocs.py", line 297, in
otx_receiver.get_iocs_last()
File "get-otx-iocs.py", line 146, in get_iocs_last
self.events = self.otx.getall()
File "/usr/lib/python2.7/site-packages/OTXv2.py", line 273, in getall
json_data = self.get(next_page_url)
File "/usr/lib/python2.7/site-packages/OTXv2.py", line 83, in get
data = response.read().decode('utf-8')
AttributeError: 'NoneType' object has no attribute 'read'
from otx-python-sdk.
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,
from otx-python-sdk.
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.
from otx-python-sdk.
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.
from otx-python-sdk.
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.
from otx-python-sdk.
Hi @maitray16 - are you still getting the same error please?
Your issue is slightly different to the other reported here.
from otx-python-sdk.
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,
from otx-python-sdk.
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.
from otx-python-sdk.
Hi @chrisdoman I am now getting the error getall() got an unexpected keyword argument 'modified_since'
from otx-python-sdk.
@chrisdoman I ran it through a list of few 100 IPs, haven't noticed an issue or NoneType errors, seems to be working fine.
from otx-python-sdk.
Hi @coppolak - try downloading the latest version of the repository and installing it, i.e.
python setup.py install
from otx-python-sdk.
Hi @chrisdoman I have the latest version
from otx-python-sdk.
@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?
from otx-python-sdk.
@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.
from otx-python-sdk.
Related Issues (20)
- Pulse Search Limitation HOT 2
- Timeout Issue with get_indicator_details_full HOT 2
- Throttling During High Volume Ingestion
- Allow requests library to take verify and cert parameters HOT 7
- 504 error when using otx.getall() method
- Python API is not returning whitelisted validation for IPv4 HOT 1
- otx.getall() having error "Exceeded maximum number of retries" HOT 9
- Gameplay HOT 1
- Pulling Private Pulses HOT 2
- Add version method to API and call in OTXv2 init method HOT 1
- No results retruned in get_indicator_details_full for IndicatorTypes.EMAIL
- Error 504 triying to get indicators HOT 2
- get_my_pulses() function forms invalid API call URL, returns empty list. HOT 1
- Sorting of response HOT 3
- getall API not working ! HOT 1
- Export API not supported anymore as per docs HOT 5
- is_malicious.py "ResourceWarning"
- Otx
- Provide a documentation of functions for the OTXv2.py file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from otx-python-sdk.