MemoryError: cómo descargar archivos grandes a través de Google Drive SDK con Python

Me estoy quedando sin memoria al descargar archivos grandes de mi Google Drive. yo asumo esotmp = content.read(1024) no funciona, pero ¿cómo solucionarlo? Gracias.

def download_file(service, file_id):
  drive_file = service.files().get(fileId=file_id).execute()
  download_url = drive_file.get('downloadUrl')
  title = drive_file.get('title')
  originalFilename = drive_file.get('originalFilename')
  if download_url:
    resp, content = service._http.request(download_url)
    if resp.status == 200:
      file = 'tmp.mp4'
      with open(file, 'wb') as f:
          while True:
              tmp = content.read(1024)
              if not tmp:
                  break
              f.write(tmp)
      return title, file
    else:
      print 'An error occurred: %s' % resp
      return None
  else:
    return None

Respuestas a la pregunta(2)

Su respuesta a la pregunta