Use shutil.copyfileobj instead of curl
Merge last 2 commits