diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index 7e4208f70..9f8a2f637 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -70,9 +70,12 @@ def esp32_build_filesystem(fs_size): if "no_files" in file: continue if "http" and "://" in file: - response = requests.get(file) + response = requests.get(file.split(" ")[0]) if response.ok: target = join(filesystem_dir,file.split(os.path.sep)[-1]) + if len(file.split(" ")) > 1: + target = join(filesystem_dir,file.split(" ")[1]) + print("Renaming",(file.split(os.path.sep)[-1]).split(" ")[0],"to",file.split(" ")[1]) open(target, "wb").write(response.content) else: print("Failed to download: ",file)