code will now save to a sqlite database the details and download to a directory