0
I found several articles on the internet about how to download a single file, but I always need to specify the name and directory of the file.
The program I would like to do needs to download all the files in this directory (eg: 191.15.5.1/pasta) and save them in the default directory where the app is.
I did something like that, but I couldn’t finish it:
def get_arqchives(url):
    res = requests.get(url)
    if res.status_code == requests.codes.OK:
       for u in res.content:
           with (endereco, 'wb') as target:
               pass
    else:
       res.raise_for_status()
I got this error:
Traceback (most recent call last):
 File "C:/Users/dannyou/PycharmProjects/autoupdater/main.py", line 34, in <module>
 downloadFile(x)
 File "C:/Users/dannyou/PycharmProjects/autoupdater/main.py", line 29, in downloadFile
 with open(path.name, 'wb') as f:
OSError: [Errno 22] Invalid argument: '?C=N;O=D'– Danillo Araújo