0

I wanted the IP-API resolve the IP that I got in the first link, but it does not work.

    #!/usr/bin/python

    import sys
    import requests
    print "Conectando com %s" % sys.argv[1]
    Get_Skype   =   requests.get("http://api.predator.wtf/resolver/?arguments=%s" % sys.argv[1]).text
    print "Entrando em %s" % Get_Skype
    My_API      =   requests.get("http://ip-api.com/json/%s" % Get_Skype).text
    print My_API

Command Line:

    $ python script.py user_skype

The api returns:

    {"message":"invalid query","query":"<ip>","status":"fail"}
Carrie Kendall
  • 11,124
  • 5
  • 61
  • 81
sk1m4x
  • 3
  • 5

1 Answers1

1

The result of the request "http://api.predator.wtf/resolver/?arguments=user_skype" which is stored in Get_Skype is

Crap, No IP Was Found!

and not a valid IP which causes your api consider it a bad query (which it actually is). So you probably should first check this result being a valid IP address, before passing it to API.

If a valid username is entered, the result of the predator query has a trailing \ufeff character, which is BOM. See here how to deal with it.

Community
  • 1
  • 1
Eugene Sh.
  • 17,802
  • 8
  • 40
  • 61