From d75f82b05f1be5911b94eb3ea48526c98f9d1b06 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Fri, 20 Oct 2023 20:16:36 +0200 Subject: [PATCH] fix zenodo file download --- .../bioimage/modelrunner/bioimageio/download/DownloadModel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java index 710fdc6a..8fe1ba6a 100644 --- a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java +++ b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadModel.java @@ -499,6 +499,8 @@ private void unzipTfWeights() throws IOException { * @throws MalformedURLException if the String does not correspond to an URL */ public static String getFileNameFromURLString(String str) throws MalformedURLException { + if (str.startsWith("https://zenodo.org/")) + str = str.substring(0, str.length() - "/content".length()); URL url = new URL(str); return new File(url.getPath()).getName(); }