Ejemplo n.º 1
0
 def search_by_query(self, query):
     """
     this function search thought instagram by query
     :param query: query string
     :return Returns a json of results
     """
     if not self.isLoggedIn:
         self.login()
     return_result = {}
     r = self.session.post(url=Instagram.search_by_query_url + query,
                           data=Instagram.generate_signature(
                               self, data=self.data),
                           headers=self.headers)
     if r.status_code == 200:
         lastJson = json.loads(r.text)
         result = lastJson
         if result["status"] != "ok":
             raise ResultNotFoundError(' result is not ok')
         if result['users']:
             try:
                 return_result = parse_search_by_query(
                     result['users'], self.process_id)
             except Exception as e:
                 raise InternalModuleError(e.__str__())
         if return_result:
             return return_result
         else:
             raise ResultNotFoundError('can not find any result')
     else:
         raise ResultNotFoundError(r.status_code)
Ejemplo n.º 2
0
 def whois_history(self, domain, api_key):
     """
     :param domain: whois_history domain requested
     :param api_key: optional, for whoxy.com api
     return whois info of domain
     """
     if not (validators.domain(domain)):
         raise InvalidInputError('invalid domain')
     try:
         url_request = "http://api.whoxy.com/?key=%s&history=%s" % (api_key,
                                                                    domain)
         with urllib.request.urlopen(url_request) as url:
             data = json.loads(url.read().decode())
             if 'status_reason' in data:
                 if data['status_reason'] == 'Incorrect API Key':
                     raise WrongApiKeyError('wrong or invalid api key')
                 else:
                     raise InvalidInputError(data['status_reason'])
             elif 'status' in data:
                 if data['status'] == 0:
                     raise InternalModuleError(
                         ' something goes wrong in api')
             if 'whois_records' not in data:
                 raise ResultNotFoundError(
                     'cant find any result for your request')
     except URLError:
         raise NetworkError('can not access whoxy.com')
     if self.parent:
         self.parent.check_point()
     result = {'results': self.parse_history(data['whois_records'])}
     return result
Ejemplo n.º 3
0
 def get_result_by_api(api_key, email, hash_code):
     url = 'https://www.cmd5.org/api.ashx?email=' + email + '&key=' + api_key + '&hash=' + hash_code
     result = Qhttp.get(url)
     if result.status_code == 200:
         if ':' in result.content.decode():
             error_code = result.content.decode().split(':')[-1]
             if error_code == '-1':
                 raise InvalidInputError(' invalid input ')
             if error_code == '-2':
                 raise InsufficientCredit('InsufficientCredit')
             if error_code == '-3':
                 raise NetworkError('server failed on cmd5.org')
             if error_code == '-4':
                 raise InvalidInputError('unknown sipher text')
             if error_code == '-7':
                 raise InvalidInputError('hash type not supported')
             if error_code == '-999':
                 raise NetworkError('some thing wrong with cmd5.org')
         try:
             return_result = {'results': result.json()}
             return return_result
         except Exception:
             ResultNotFoundError(' unknown result format ')
     else:
         raise NetworkError(result.status_code)
Ejemplo n.º 4
0
 def profile(self, user_id):
     """
     this function show the user's post
     :param user_id: user_id or username as string, set for profile request
     :return Returns a json of user's account info
     """
     if not self.isLoggedIn:
         self.login()
     self.update_progressbar('request submitted: check profile', 10)
     if user_id.isdigit():  # create url base on username or pk received
         url = Instagram.profile_url_user_id.format(user_id)
     else:
         url = Instagram.profile_url_username.format(user_id)
     self.update_progressbar('set request to instagram api', 20)
     try:  # set request to insta
         r = self.session.get(url=url,
                              data=Instagram.generate_signature(
                                  self, data=self.data),
                              headers=self.headers)
     except Exception:
         raise NetworkError(' can not access api')
     if r.status_code == 200:
         result = r.json()
         if self.parent:
             self.parent.check_point()
         self.update_progressbar('parse_result', 80)
         result = parse_profile(result, user_id, self.process_id)
         return result
     else:
         if r.status_code == 404:
             raise ResultNotFoundError('not found profile')
         else:
             raise NetworkError(r.status_code)
Ejemplo n.º 5
0
    def get_result(self, search_term, api_key_value, cse_id_value, pages, **kwargs):
        """
        :param search_term: query for search
        :param api_key_value: google api key
        :param cse_id_value: custom search engine id
        :param pages: number of google pages wants to search
        :param kwargs:
        :return: list of result from custom google search api
        """
        return_result = {}
        # build a google custom search v1
        try:
            service = build("customsearch", "v1", developerKey=api_key_value,
                            cache_discovery=False)
        except httplib2.ServerNotFoundError:
            raise NetworkError('Unable to find the server at www.googleapis.com')

        result_list = []
        if pages:
            self.pages = pages
        # iterate on number of excepted result, save one page on each iteration
        for i in range(pages):
            start_point_of_search_result = (i * 10) + 1
            self.parent.check_point()
            try:
                # dictionary which is produced by google custom search api
                result_dict_temp = (
                    service.cse().list(q=search_term, cx=cse_id_value, num=10, start=start_point_of_search_result,
                                       **kwargs).execute())

                # extract items from dictionary and reformat it
                if 'items' in result_dict_temp:
                    temp_parsed_result = self.parse_result(
                        result_dict_temp['items'])
                    for element in temp_parsed_result:
                        result_list.append(element)
                # update progressbar value
                self.update_progressbar(" Pages has been searched: " + str(i + 1),
                                        (100 * (i + 1) / self.pages))
            # invalid api_key or cse_id
            except HttpError as e:
                if "Invalid Value" in str(e):
                    raise WrongCseKeyError("wrong cse_id number")

                elif "Bad Request" in str(e):
                    raise WrongApiKeyError("wrong api_key number")
                elif 'Forbidden' in str(e):
                    raise WrongCseKeyError('wrong api_key or wrong cse_key')
                else:
                    raise NetworkError(e)
            except Exception as e:
                raise NetworkError(e)
            # no result found
            if len(result_list) == 0:
                raise ResultNotFoundError(' can not find result for your query')

        return_result['results'] = result_list
        return return_result
Ejemplo n.º 6
0
    def search_number(self, number):
        if not self.isLoggedIn:
            self.login()
        contacts = []
        return_result = ''
        contact = dict()
        if not str(int(number)).isdigit():
            raise InvalidInputError('invalid phone number format')
        contact["phone_numbers"] = [number]
        contact["first_name"] = number
        contact["email_addresses"] = []
        contacts.append(contact)

        r = self.session.post(url=Instagram.sync_address_book_url,
                              data="contacts=" + json.dumps(contacts),
                              headers=self.headers)

        if r.status_code == 200:
            lastJson = json.loads(r.text)
            result = lastJson
            if result["status"] != "ok":
                raise ResultNotFoundError(' result is not ok')
            for item in result["items"]:
                try:
                    return_result = parse_search_contact(
                        item['user'], self.process_id)

                except Exception:
                    continue
            a = self.session.post(url=Instagram.unlink_address_book_url,
                                  headers=self.headers)
            if return_result:
                return return_result
            else:
                a = self.session.post(url=Instagram.unlink_address_book_url,
                                      headers=self.headers)
                raise ResultNotFoundError(
                    'user that belong to this phone number not found')
        else:
            a = self.session.post(url=Instagram.unlink_address_book_url,
                                  headers=self.headers)
            raise ResultNotFoundError(r.text)
Ejemplo n.º 7
0
def parse_reverse(data):
    """
    :param data: use this data for parsing and get final result
    return parsed data
    """
    known_value = []
    result_list = []
    if 'search_result' in data:
        search_list = data['search_result']
    else:
        raise ResultNotFoundError('not found any whois for your request')
    for search in search_list:
        temp_result = {'data': '', 'type': 12, 'properties': []}
        if 'domain_name' in search:
            if search['domain_name'] not in known_value:
                known_value.append(search['domain_name'])
            temp_result['data'] = search['domain_name']
        if 'registrant_contact' in search:
            if 'full_name' in search['registrant_contact']:
                temp_result['properties'].append({
                    'registrant_name':
                    search['registrant_contact']['full_name'],
                    'type':
                    11
                })

            else:
                temp_result['properties'].append({
                    'registrant_name': '',
                    'type': 11
                })

            if 'email_address' in search['registrant_contact']:
                temp_result['properties'].append({
                    'registrant_email_address':
                    search['registrant_contact']['email_address'],
                    'type':
                    2
                })
            else:
                temp_result['properties'].append({
                    'registrant_email_address': '',
                    'type': 2
                })
        else:
            temp_result['properties'].append({
                'registrant_email_address': '',
                'type': 2
            })
            temp_result['properties'].append({
                'registrant_name': '',
                'type': 11
            })

        if 'domain_registrar' in search:
            if 'registrar_name' in search['domain_registrar']:
                temp_result['properties'].append({
                    'registrar_name':
                    search['domain_registrar']['registrar_name'],
                    'type':
                    11
                })

            else:
                temp_result['properties'].append({
                    'registrar_name': '',
                    'type': 11
                })
        else:
            temp_result['properties'].append({
                'registrar_name': '',
                'type': 11
            })

        if 'expiry_date' in search:
            temp_result['properties'].append({
                'expiration_date':
                search['expiry_date'],
                'type':
                0
            })
        else:
            temp_result['properties'].append({
                'expiration_date': '',
                'type': 0
            })

        result_list.append(temp_result)
    return result_list
Ejemplo n.º 8
0
    def get_follower_following(self, user_id, request_type):
        """
        this function show the user's follower/following list
        :param user_id: user_id or username as string
        :param request_type: follower/ following
        :return Returns a json of user's account info
        """
        if not self.isLoggedIn:
            self.login()
        base_url = ''
        user = []
        self.update_progressbar('request submitted: get follower', 10)
        # preparing urls:
        if request_type == 'follower':
            if user_id.isdigit():  # create url base on username or pk received
                base_url = Instagram.get_follower_url.format(user_id)
            else:
                pk = self.profile(user_id)[1]['pk']
                base_url = Instagram.get_follower_url.format(pk)

        elif request_type == 'following':
            if user_id.isdigit():  # create url base on username or pk received
                base_url = Instagram.get_following_url.format(user_id)
            else:

                pk = self.profile(user_id)[1]['pk']
                base_url = Instagram.get_following_url.format(pk)
        self.update_progressbar('set request to Instagram api', 20)

        if self.parent:
            self.parent.check_point()
        try:  # set request to insta
            r = self.session.get(url=base_url,
                                 data=Instagram.generate_signature(
                                     self, data=self.data),
                                 headers=self.headers)
        except Exception as e:
            raise NetworkError(' can not access api' + e.__str__())
        if r.status_code == 200:
            result = r.json()
            if self.parent:
                self.parent.check_point()
            user.extend(result['users'])
        else:
            if r.status_code == 404:
                raise ResultNotFoundError('not found profile')
            else:
                raise NetworkError(r.status_code, r.text)
        while True:  # continue to extract person til reach request number or follower/following list finish
            if self.parent:
                self.parent.check_point()
            if len(user) <= self.request_number:
                if 'next_max_id' in result.keys():
                    max_id = result[
                        'next_max_id']  # extract person from continues list
                    try:  # set request to insta
                        url = base_url + '?max_id=' + max_id
                        r = self.session.get(url=url,
                                             data=Instagram.generate_signature(
                                                 self, data=self.data),
                                             headers=self.headers)
                    except Exception:
                        break  # in case of that s.t happening and can not extract more person
                    try:
                        if r.status_code == 200:
                            result = r.json()
                            if self.parent:
                                self.parent.check_point()
                            # parsing results
                            user.extend(
                                result['users']
                            )  # adding profiles tp result till reach max_result number
                        else:
                            break  # in case of that s.t happening and can not extract more person
                    except Exception:
                        break  # in case of that s.t happening and can not extract more person
                else:
                    break  # in case of reaching end of follower/following list
            else:
                break  # in case of reaching request number
        # parsing result from extract info
        if self.parent:
            self.parent.check_point()
        self.update_progressbar('parse_result', 80)
        result = parse_follower_following(user, user_id, self.process_id,
                                          self.request_number)
        return result
Ejemplo n.º 9
0
    def __parse_search(self, searchs):
        result = {'results': ''}
        result_list = []
        entity_list = []
        for search in searchs:

            # define necessary dict for each result
            if self.parent:
                self.parent.check_point()
            alias = ''
            temp_result = {
                'data': '',
                'type': 5,
                'properties': [],
                'special_properties': [{
                    'sub_type': 2,
                    'type': 0
                }]
            }
            name = {'name': '', 'type': 11}
            description = {'description': '', 'type': 0}
            url = {'url': [], 'type': 1}
            url_unexpand = {'title': ''}
            url_expand = {'title': ''}
            screen_name = {'screen_name': '', 'type': 5}
            location = {'location': '', 'type': 8}
            protected = {'protected': '', 'type': 0}
            verified = {'verified': '', 'type': 0}
            followers_count = {'followers_count': '', 'type': 0}
            friends_count = {'friends_count': '', 'type': 0}
            listed_count = {'listed_count': '', 'type': 0}
            favourites_count = {'favourites_count': '', 'type': 0}
            statuses_count = {'statuses_count': '', 'type': 0}
            created_at = {'created_at': '', 'type': 0}
            geo_enabled = {'geo_enabled': '', 'type': 0}
            lang = {'lang': '', 'type': 11}
            contributors_enabled = {'contributors_enabled': '', 'type': 0}
            profile_background_image_url_https = {
                'profile_background_image_url': '',
                'type': 13,
                'more': {
                    'ref': '',
                    'url': ''
                }
            }
            profile_background_image_url_https_thumbnail = {
                'profile_background_image_url_thumbnail': '',
                'type': 13,
                'more': {
                    'ref': '',
                    'url': ''
                }
            }
            profile_banner_url = {
                'profile_banner_url': '',
                'type': 13,
                'more': {
                    'ref': '',
                    'url': ''
                }
            }
            profile_banner_url_thumbnail = {
                'profile_banner_url_thumbnail': '',
                'type': 13,
                'more': {
                    'ref': '',
                    'url': ''
                }
            }
            profile_image_url_https = {
                'profile_image_url': '',
                'type': 13,
                'more': {
                    'ref': '',
                    'url': ''
                }
            }
            profile_image_url_https_thumbnail = {
                'profile_image_url_thumbnail': '',
                'type': 13,
                'more': {
                    'ref': '',
                    'url': ''
                }
            }

            if 'screen_name' in search:
                temp_result['data'] = search['screen_name']
                screen_name['screen_name'] = search['screen_name']
                alias = search['screen_name']
            if 'description' in search:
                description['description'] = search['description']
            if 'name' in search:
                name['name'] = search['name']
            if 'url' in search:
                url_expand['title'] = search['url']
            if 'screen_name' in search:
                temp_result['data'] = search['screen_name']
                screen_name['screen_name'] = search['screen_name']
            if 'location' in search:
                location['location'] = search['location']
            if 'protected' in search:
                protected['protected'] = search['protected']
            if 'verified' in search:
                verified['verified'] = search['verified']
            if 'followers_count' in search:
                followers_count['followers_count'] = search['followers_count']
            if 'friends_count' in search:
                friends_count['friends_count'] = search['friends_count']
            if 'listed_count' in search:
                listed_count['listed_count'] = search['listed_count']
            if 'favourites_count' in search:
                favourites_count['favourites_count'] = search[
                    'favourites_count']
            if 'statuses_count' in search:
                statuses_count['statuses_count'] = search['statuses_count']
            if 'created_at' in search:
                created_at['created_at'] = search['created_at']
            if 'geo_enabled' in search:
                geo_enabled['geo_enabled'] = search['geo_enabled']
            if 'lang' in search:
                lang['lang'] = search['lang']
            if 'contributors_enabled' in search:
                contributors_enabled['contributors_enabled'] = search[
                    'contributors_enabled']
            try:
                if 'profile_background_image_url_https' in search:
                    profile_background_image_url_https_list = self.__save_image(
                        search['profile_background_image_url_https'], alias)
                    profile_background_image_url_https['profile_background_image_url'] = \
                        profile_background_image_url_https_list[0]
                    profile_background_image_url_https['more'][
                        'ref'] = 'https://twitter.com/' + alias
                    profile_background_image_url_https['more']['url'] = search[
                        'profile_background_image_url_https']
                    profile_background_image_url_https['more'][
                        'file_name'] = profile_background_image_url_https_list[
                            2]

                    profile_background_image_url_https_thumbnail['profile_background_image_url_thumbnail'] = \
                        profile_background_image_url_https_list[1]
                    profile_background_image_url_https_thumbnail['more'][
                        'ref'] = 'https://twitter.com/' + alias
                    profile_background_image_url_https_thumbnail['more'][
                        'url'] = search['profile_background_image_url_https']
                    profile_background_image_url_https_thumbnail['more']['file_name'] = \
                        profile_background_image_url_https_list[2]
            except Exception:
                profile_background_image_url_https = {
                    'profile_background_image_url': '',
                    'type': 13,
                    'more': {
                        'ref': '',
                        'url': ''
                    }
                }
                profile_background_image_url_https_thumbnail = {
                    'profile_background_image_url_thumbnail': '',
                    'type': 13,
                    'more': {
                        'ref': '',
                        'url': ''
                    }
                }
            try:
                if 'profile_banner_url' in search:
                    profile_banner_url_list = self.__save_image(
                        search['profile_banner_url'], alias)
                    profile_banner_url[
                        'profile_banner_url'] = profile_banner_url_list[0]
                    profile_banner_url['more'][
                        'ref'] = 'https://twitter.com/' + alias
                    profile_banner_url['more']['url'] = search[
                        'profile_banner_url']
                    profile_banner_url['more'][
                        'file_name'] = profile_banner_url_list[2]

                    profile_banner_url_thumbnail[
                        'profile_banner_url_thumbnail'] = profile_banner_url_list[
                            1]
                    profile_banner_url_thumbnail['more'][
                        'ref'] = 'https://twitter.com/' + alias
                    profile_banner_url_thumbnail['more']['url'] = search[
                        'profile_banner_url']
                    profile_banner_url_thumbnail['more'][
                        'file_name'] = profile_banner_url_list[2]
            except Exception:
                profile_banner_url = {
                    'profile_banner_url': '',
                    'type': 13,
                    'more': {
                        'ref': '',
                        'url': ''
                    }
                }
                profile_banner_url_thumbnail = {
                    'profile_banner_url_thumbnail': '',
                    'type': 13,
                    'more': {
                        'ref': '',
                        'url': ''
                    }
                }
            try:
                if 'profile_image_url_https' in search:
                    profile_image_url_https_list = self.__save_image(
                        search['profile_image_url_https'], alias)
                    profile_image_url_https[
                        'profile_image_url'] = profile_image_url_https_list[0]
                    profile_image_url_https['more'][
                        'ref'] = 'https://twitter.com/' + alias
                    profile_image_url_https['more'][
                        'file_name'] = profile_image_url_https_list[2]
                    profile_image_url_https['more']['url'] = search[
                        'profile_image_url_https']

                    profile_image_url_https_thumbnail[
                        'profile_image_url_thumbnail'] = profile_image_url_https_list[
                            1]
                    profile_image_url_https_thumbnail['more'][
                        'ref'] = 'https://twitter.com/' + alias
                    profile_image_url_https_thumbnail['more'][
                        'file_name'] = profile_image_url_https_list[2]
                    profile_image_url_https_thumbnail['more']['url'] = search[
                        'profile_image_url_https']
            except Exception:
                profile_image_url_https = {
                    'profile_image_url': '',
                    'type': 13,
                    'more': {
                        'ref': '',
                        'url': ''
                    }
                }
                profile_image_url_https_thumbnail = {
                    'profile_image_url_thumbnail': '',
                    'type': 13,
                    'more': {
                        'ref': '',
                        'url': ''
                    }
                }

            # create structure of final result
            temp_result['properties'].append(name)
            temp_result['properties'].append(description)
            url['url'].append(url_unexpand)
            url['url'].append(url_expand)
            temp_result['properties'].append(url)
            temp_result['special_properties'].append(screen_name)
            temp_result['special_properties'].append(location)
            temp_result['special_properties'].append(protected)
            temp_result['special_properties'].append(verified)
            temp_result['special_properties'].append(followers_count)
            temp_result['special_properties'].append(friends_count)
            temp_result['special_properties'].append(listed_count)
            temp_result['special_properties'].append(favourites_count)
            temp_result['special_properties'].append(statuses_count)
            temp_result['special_properties'].append(created_at)
            temp_result['special_properties'].append(geo_enabled)
            temp_result['special_properties'].append(lang)
            temp_result['special_properties'].append(contributors_enabled)
            temp_result['special_properties'].append(
                profile_background_image_url_https)
            temp_result['special_properties'].append(
                profile_background_image_url_https_thumbnail)
            temp_result['special_properties'].append(profile_banner_url)
            temp_result['special_properties'].append(
                profile_banner_url_thumbnail)
            temp_result['special_properties'].append(profile_image_url_https)
            temp_result['special_properties'].append(
                profile_image_url_https_thumbnail)
            result_list.append(temp_result)
            entity_list.append(screen_name)
            entity_list.append(location)
            entity_list.append(name)
        if len(result_list) == 0:
            raise ResultNotFoundError('not found any result')
        result['results'] = result_list
        return result, entity_list
Ejemplo n.º 10
0
    def get_ip_info(self, ip):
        """
        this function get the given ip information
        :return Returns ip information in json format
        """
        api_key = self.api_key
        if self.parent:
            self.parent.check_point()
        self.update_progressbar('set request to get ip info', 20)
        try:
            r = requests.get('https://api.ip2location.com/?ip=' + ip +
                             '&key=' + api_key + '&package=WS24&format=json')
        except (requests.exceptions.RequestException,
                requests.exceptions.ConnectionError):
            raise NetworkError(' can no access api')
        if r.status_code == 200:
            result = json.loads(r.content.decode())
            temp = list()
            self.update_progressbar('parsing result', 60)
            if self.parent:
                self.parent.check_point()
            if 'response' in result:
                if result['response'] == 'INSUFFICIENT CREDIT':
                    raise InsufficientCredit(result['response'])
                elif result['response'] == 'INVALID ACCOUNT':
                    raise WrongApiKeyError(result['response'])
                else:
                    raise InternalModuleError(result['response'])
            else:
                longitude = 'unknown'
                latitude = 'unknown'
                if result.items():
                    for k, v in result.items():
                        # parsing result
                        if k in [
                                'country_name', 'region_name', 'city_name',
                                'isp', 'mobile_brand'
                        ]:
                            temp.append({
                                self.get_ip_info_keys[k]: v,
                                "type": 11
                            })
                        elif k in ['domain']:
                            temp.append({
                                self.get_ip_info_keys[k]: v,
                                "type": 12
                            })

                        elif k in ['usage_type']:
                            for each in v.split('/'):
                                try:
                                    temp.append({
                                        self.get_ip_info_keys[k]:
                                        self.usage_and_proxy_type[each],
                                        "type":
                                        0
                                    })
                                except KeyError:
                                    pass

                        elif k in [
                                'latitude', 'zip_code', 'time_zone',
                                'idd_code', 'area_code', 'elevation', 'mcc',
                                'mnc', 'net_speed', 'longitude'
                        ]:
                            temp.append({k: v, "type": 0})
                            if k == 'longitude':
                                longitude = v
                            if k == 'latitude':
                                latitude = v
                        else:
                            pass  # new key is founded
                    geo_coordinates = str(latitude) + ',' + str(longitude)
                    geo_record = {
                        'geo_coordinates': geo_coordinates,
                        'type': 14
                    }
                    final = {
                        "properties": [],
                        "special_properties": temp,
                        "results": [geo_record]
                    }
                    return final
                else:
                    raise ResultNotFoundError(
                        'no result found for your request')

        else:
            if r.status_code == 404:
                raise ResultNotFoundError('no result found for your request')
            NetworkError('status code: ', r.status_code)
Ejemplo n.º 11
0
    def ip_is_proxy(self, ip):
        """
        this function specifies whether the given ip is proxy or not
        :return Returns ip information as a dictionary
        """
        api_key = self.api_key
        self.update_progressbar('set request to is it proxy', 20)
        if self.parent:
            self.parent.check_point()
        try:
            r = requests.get('http://api.ip2proxy.com/?ip=' + ip + '&key=' +
                             api_key + '&package=PX4&format=json‬‬')
        except (requests.exceptions.RequestException,
                requests.exceptions.ConnectionError):
            raise NetworkError(' can not access api')
        if r.status_code == 200:
            result = json.loads(r.content.decode())
            self.update_progressbar('parsing result', 60)
            if self.parent:
                self.parent.check_point()
            if 'response' in result:
                temp = list()
                if result['response'] == 'OK':
                    if result.items():
                        # parsing result
                        for k, v in result.items():
                            if k in [
                                    'countryName', 'regionName', 'cityName',
                                    'isp'
                            ]:
                                temp.append({
                                    self.ip_is_proxy_keys[k]: v,
                                    "type": 11
                                })

                            elif k in ['proxyType']:
                                for each in v.split('/'):
                                    try:
                                        temp.append({
                                            self.ip_is_proxy_keys[k]:
                                            self.usage_and_proxy_type[each],
                                            "type":
                                            0
                                        })
                                    except KeyError:
                                        temp.append({
                                            self.ip_is_proxy_keys[k]: v,
                                            "type": 0
                                        })

                            elif k in ['isProxy']:
                                temp.append({
                                    self.ip_is_proxy_keys[k]: v,
                                    "type": 0
                                })
                            else:
                                pass
                        final = {
                            "properties": [],
                            "special_properties": temp,
                            "results": []
                        }
                        return final
                    else:
                        raise ResultNotFoundError(
                            'no result found for your request')
                else:
                    if result['response'] == 'INSUFFICIENT CREDIT':
                        raise InsufficientCredit(result['response'])
                    elif result['response'] == 'INVALID ACCOUNT':
                        raise WrongApiKeyError(result['response'])
                    else:
                        raise InternalModuleError(result['response'])
            else:
                raise NetworkError(r.status_code)
        else:
            if r.status_code == 404:
                raise ResultNotFoundError('no result found for your request')
            else:
                raise NetworkError('status_code ' + str(r.status_code))