Almost done - the script asks for user input for the download dir and ensures it's writeable. If it doesn't exist it tries to create it - otherwise just loops round. Then it goes and grabs the file. Needs a little bit of niceness to tidy up things like title, file extension etc.