Preview:
'''def download_data(urls):
    filenames = []
    
    for i, link in enumerate(urls):
        try:
            result = requests.get(link, cookies={'urs_user': 'liviaalvzs', 'urs_pass': 'Ss1234567890?'})
            result.raise_for_status()
            
            basename = get_filenames_from_urls(link)
            filenames.append(basename)
            
            with open(basename, 'wb') as f:
                f.write(result.content)
            
            print(f'O arquivo do link {link} foi baixado com sucesso e salvo como {basename}.')
            
        except requests.exceptions.HTTPError as errh:
            print ("HTTP Error:",errh)
        except requests.exceptions.ConnectionError as errc:
            print ("Error Connecting:",errc)
        except requests.exceptions.Timeout as errt:
            print ("Timeout Error:",errt)
        except requests.exceptions.RequestException as err:
            print ("Something went wrong:",err)
        
    return filenames
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter