Giter Site home page Giter Site logo

Comments (15)

joaquinrinaudo-olx avatar joaquinrinaudo-olx commented on September 26, 2024 1

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.

coppolak avatar coppolak commented on September 26, 2024

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.

chrisdoman avatar chrisdoman commented on September 26, 2024

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.

coppolak avatar coppolak commented on September 26, 2024

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.

chrisdoman avatar chrisdoman commented on September 26, 2024

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.

coppolak avatar coppolak commented on September 26, 2024

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.

chrisdoman avatar chrisdoman commented on September 26, 2024

Hi @maitray16 - are you still getting the same error please?

Your issue is slightly different to the other reported here.

from otx-python-sdk.

chrisdoman avatar chrisdoman commented on September 26, 2024

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.

maitray16 avatar maitray16 commented on September 26, 2024

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.

coppolak avatar coppolak commented on September 26, 2024

Hi @chrisdoman I am now getting the error getall() got an unexpected keyword argument 'modified_since'

from otx-python-sdk.

maitray16 avatar maitray16 commented on September 26, 2024

@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.

chrisdoman avatar chrisdoman commented on September 26, 2024

Hi @coppolak - try downloading the latest version of the repository and installing it, i.e.
python setup.py install

from otx-python-sdk.

coppolak avatar coppolak commented on September 26, 2024

Hi @chrisdoman I have the latest version

from otx-python-sdk.

coppolak avatar coppolak commented on September 26, 2024

@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.

chrisdoman avatar chrisdoman commented on September 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.