You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Potentially I'm just being dumb, but I'm running into this weird situation where the PyImgur is able to upload 2 or so images and then it starts complaining that I have the wrong client ID.
I tried slowing it down thinking I was hitting Imgur's API limit, but even at 10 second delays, it still pops up. I don't see any warning from Imgur that my client ID is bad, so I'm not sure what's going on...
Traceback (most recent call last):
File "", line 76, in
main()
File "", line 70, in main
link = ImgurBatch(files)
File "", line 57, in ImgurBatch
links.append(imgurupload(item))
File "", line 24, in imgurupload
uploaded_image = im.upload_image(PATH, title="")
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyimgur_init_.py", line 1150, in upload_image
resp = self._send_request(self.base_url + "/3/image",
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyimgur_init.py", line 731, in _send_request
result = request.send_request(url, verify=self.verify, **kwargs)
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyimgur\request.py", line 102, in send_request
resp.raise_for_status()
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Permission Denied for url: https://api.imgur.com/3/image
The text was updated successfully, but these errors were encountered:
I was experiencing the same issue and messed around with my code to make it work. This may or may not work for you but hope it helps.
So the way my code worked is it used a loop to upload a series of images it created. The issue seemed to be that I declared my client ID within the loop, thus creating parallel sessions with the same client ID, which I suppose set off some flag on imgur's end.
Therefore, make sure you're not authenticating your client ID every time you upload an image as it's not necesary.
Check out my fixed code below:
im = pyimgur.Imgur("XXX")
for i in range(10):
uploaded_image = im.upload_image("current_qr.png")
link_to_image = (uploaded_image.link)
Potentially I'm just being dumb, but I'm running into this weird situation where the PyImgur is able to upload 2 or so images and then it starts complaining that I have the wrong client ID.
I tried slowing it down thinking I was hitting Imgur's API limit, but even at 10 second delays, it still pops up. I don't see any warning from Imgur that my client ID is bad, so I'm not sure what's going on...
Traceback (most recent call last):
File "", line 76, in
main()
File "", line 70, in main
link = ImgurBatch(files)
File "", line 57, in ImgurBatch
links.append(imgurupload(item))
File "", line 24, in imgurupload
uploaded_image = im.upload_image(PATH, title="")
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyimgur_init_.py", line 1150, in upload_image
resp = self._send_request(self.base_url + "/3/image",
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyimgur_init.py", line 731, in _send_request
result = request.send_request(url, verify=self.verify, **kwargs)
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyimgur\request.py", line 102, in send_request
resp.raise_for_status()
File "C:\Users\Bram\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Permission Denied for url: https://api.imgur.com/3/image
The text was updated successfully, but these errors were encountered: