#๐Ÿ”’ Converting sync requests code to aiohttp yields error

10 messages ยท Page 1 of 1 (latest)

dreamy haven
#

I made a program to download some files from a website using requests. Since there are quite a few files and it takes quite a while to download everything, I thought about making it async, and apparently aiohttp is the way to go.

However, when running the updated code, I get the following error:
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host [WEBSITE] ssl:default [Invalid argument]. Googling it a bit I didn't find anyone with the same exact problem, and the solutions posted for similar problems didn't work. Does anyone have a clue what I could be doing wrong?

analog nymphBOT
#

@dreamy haven

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

blazing horizon
#

show your code?

quaint briar
dreamy haven
#

I used everything as in the docs though, I'm really not sure how this error came to be

#

Nevermind, i solved the issue with a threadpool

#

!close

analog nymphBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.