Ge0rg3/requests-ip-rotator

Unable to find credentials

KeparYTbcc opened this issue · 3 comments

Starting API gateways in 10 regions.
Traceback (most recent call last):
  File "C:\Users\my-pc2\Downloads\Kepar stuff\SB\nekodownload\nekodownload copy.py", line 152, in <module>
    with ApiGateway("https://nekobot.xyz") as g:
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\requests_ip_rotator\ip_rotator.py", line 47, in __enter__
    self.start()
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\requests_ip_rotator\ip_rotator.py", line 250, in start
    result = future.result()
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 438, in result
    return self.__get_result()
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\_base.py", line 390, in __get_result
    raise self._exception
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\concurrent\futures\thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\requests_ip_rotator\ip_rotator.py", line 86, in init_gateway
    current_apis = awsclient.get_rest_apis()["items"]
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\client.py", line 395, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\client.py", line 711, in _make_api_call
    http, parsed_response = self._make_request(
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\client.py", line 731, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\endpoint.py", line 107, in make_request
    return self._send_request(request_dict, operation_model)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\endpoint.py", line 180, in _send_request
    request = self.create_request(request_dict, operation_model)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\endpoint.py", line 120, in create_request
    self._event_emitter.emit(event_name, request=request,
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\hooks.py", line 357, in emit
    return self._emitter.emit(aliased_event_name, **kwargs)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\hooks.py", line 228, in emit
    return self._emit(event_name, kwargs)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\hooks.py", line 211, in _emit
    response = handler(**kwargs)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\signers.py", line 93, in handler
    return self.sign(operation_name, request)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\signers.py", line 165, in sign
    auth.add_auth(request)
  File "C:\Users\my-pc2\AppData\Local\Programs\Python\Python310\lib\site-packages\botocore\auth.py", line 388, in add_auth
    raise NoCredentialsError()
botocore.exceptions.NoCredentialsError: Unable to locate credentials

C:\Users\my-pc2\Downloads\Kepar stuff\SB\nekodownload>
import requests
import wget
import os
import os.path
from time import sleep
from requests_ip_rotator import ApiGateway

os.system('cls')

current = os.getcwd()

def bar_custom(current, total, width=0):
    pass

with ApiGateway("https://nekobot.xyz") as g:
    while True:
        session = requests.Session()
        session.mount("https://nekobot.xyz", g)
        with session.get("https://nekobot.xyz/api/image?type=hthigh&image=") as r:
            res = r.json()
            image = res['message']
        if os.path.isfile(current + "\\images\\" + image[30:999990]) == True:
            pass
        else:
            try:
                a = wget.download(image, current + "\\images\\", bar=bar_custom)
                print('Downloaded: ' + current + "\\" + image[30:999990])
            except:
                print('Error retrying in a min')
                sleep(60)

Hi, I'm afraid there aren't many details given here so quite hard to help. Have you set your AWS credentials, as detailed in the docs?

Hi, closing this issue as unresponsive. Please let me know if you need any further help.