code: def download(self, url, file):
          
          if isinstance(file, str) or isinstance(file, unicode):
              file = open(file, 'wb')
          webclient = self.dupe()
          webclient.request('GET', url)
          rsp = webclient.getresponse()
          self._currdl = rsp
          self._dlfile = file
          for chunk in iter(lambda: rsp.read(16384), ''):
              file.write(chunk)
          self._currdl = None
          file.close()
docs: Download a file to filename or file object