Giter Site home page Giter Site logo

Comments (6)

patilnikhilh80 avatar patilnikhilh80 commented on August 12, 2024

if anyone can help
@ChuckWoodraska @jmeridth @timothycrosley

from python_api.

jmeridth avatar jmeridth commented on August 12, 2024

@patilnikhilh80 Can you please provide the code snippet you're using that works on windows but fails on Linux? My first thought is a path issue. But your snippet will help confirm my suspicion.

Please note that I don't work for DomainTools anymore but willing to help.

from python_api.

patilnikhilh80 avatar patilnikhilh80 commented on August 12, 2024

Line where I get error in mywork.py
riskscore = json.loads(str(self.domaintools_client.risk(url)))
domaintools_client is

import domaintools
import requests
class DomainToolsClient:

    def __init__(self, api_name, api_key, proxy=None):
        self.api_name = api_name
        self.api_key = api_key
        self.proxy = None
        self.api = domaintools.API(self.api_name, self.api_key)
        if proxy:
            self.proxy = {"https_proxy": proxy}
            self.api = domaintools.API(self.api_name, self.api_key, proxy_url=proxy, verify_ssl=False)

    def investigate(self, domain):
        params = {"api_username": self.api_name,
                  "api_key": self.api_key}
        res = requests.get(f"https://api.domaintools.com/v1/iris-investigate/{domain}", params=params,
                           proxies=self.proxy)
        return res.json()

    def risk(self, domain):
        return self.api.risk(domain)

@jmeridth

from python_api.

patilnikhilh80 avatar patilnikhilh80 commented on August 12, 2024

This issue was caused because of improper proxy settings.
Generally we set proxies as dictionary, but here we need to set it as string,
Ex. Generally
proxy = {'http': 'something', 'https': 'something'}In this case
proxy = 'something'

It too so long to identify its a proxy issue due to improper error handling in package. Difficult to find out from following error.

AttributeError: 'dict' object has no attribute 'decode'
'dict' object has no attribute 'decode'

maybe we can improve the error msg to understand it more easily. Like invalid proxy or something.

Can I open PR, seems don't have access though.

from python_api.

jmeridth avatar jmeridth commented on August 12, 2024

@patilnikhilh80 nice catch.

You can fork the repository and issue a pull request from there. You won't have access to create a branch on this repo directly.

from python_api.

mccarthym avatar mccarthym commented on August 12, 2024

Thank you for the comment @patilnikhilh80, per @ChuckWoodraska's comment above, we've tried to improve our messaging for issues such as this.

from python_api.

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.