'Rename and download links - CSV file

I have a CSV file with 6 columns and many rows. I would like to download all the png or jpg from the column 'link' in a folder with the same name of my CSV file.Then I would like to rename these images with each 'title' content.

url1.png by name1.png for each files and until the last row..

I started something with this -

import csv
with open('name.csv') as csvfile:
    reader = csv.reader(csvfile, delimiter=',', quotechar='|')
    for row in reader:
        fileurl = row[0]
        filename = row[1]
        urllib.request.urlretrieve(fileurl, "name" + filename)

Rows example -

enter image description here

Still learning.. Any help or suggestions to do this?

Many thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source