new version of download_applydiffs.py