Skip to content

Commit

Permalink
Use curl for Ljubljana download (#10)
Browse files Browse the repository at this point in the history
* updated wget to curl to bypass google drive page

* formatting and nbdev
  • Loading branch information
momen-mh authored Jul 12, 2024
1 parent e54c222 commit f000ef5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions diffdrrdata/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ def download_deepfluoro():
# %% ../notebooks/02_utils.ipynb 7
def download_ljubljana():
data_home = get_data_home()
download_link = "https://drive.usercontent.google.com/download?id=1x585pGLI8QGk21qZ2oGwwQ9LMJ09Tqrx&export=download&authuser=0"
download_path = data_home / "ljubljana.h5"
download_link = "https://drive.usercontent.google.com/download?id=1x585pGLI8QGk21qZ2oGwwQ9LMJ09Tqrx&confirm=xxx"
download_path = data_home / "ljubljana.zip"
subprocess.run(
f"wget -q --no-check-certificate -O {download_path} {download_link}".split(" ")
f"curl -s {download_link} -o {download_path} ".split(" ")
)
subprocess.run(f"unzip -o {download_path} -d {data_home}".split(" "))
subprocess.run(f"rm {download_path}".split(" "))
6 changes: 3 additions & 3 deletions notebooks/02_utils.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@
"#| export\n",
"def download_ljubljana():\n",
" data_home = get_data_home()\n",
" download_link = \"https://drive.usercontent.google.com/download?id=1x585pGLI8QGk21qZ2oGwwQ9LMJ09Tqrx&export=download&authuser=0\"\n",
" download_path = data_home / \"ljubljana.h5\"\n",
" download_link = \"https://drive.usercontent.google.com/download?id=1x585pGLI8QGk21qZ2oGwwQ9LMJ09Tqrx&confirm=xxx\"\n",
" download_path = data_home / \"ljubljana.zip\"\n",
" subprocess.run(\n",
" f\"wget -q --no-check-certificate -O {download_path} {download_link}\".split(\" \")\n",
" f\"curl -s {download_link} -o {download_path} \".split(\" \")\n",
" )\n",
" subprocess.run(f\"unzip -o {download_path} -d {data_home}\".split(\" \"))\n",
" subprocess.run(f\"rm {download_path}\".split(\" \"))"
Expand Down

0 comments on commit f000ef5

Please sign in to comment.