From 38a8f0317f4c06c1ed9d412a9af5ee27189774f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20P=C3=A9rez-Garc=C3=ADa?= Date: Sun, 26 Nov 2023 23:30:27 +0000 Subject: [PATCH] Add support for JMLR --- chrome/background.js | 2 ++ firefox/background.js | 2 ++ tests/testcases.yaml | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/chrome/background.js b/chrome/background.js index ece8bd2..2cdc77a 100644 --- a/chrome/background.js +++ b/chrome/background.js @@ -20,6 +20,8 @@ const TARGET_URL_REGEXP_REPLACE = [ [/^.*:\/\/proceedings\.mlr\.press\/(.*?)\/(.*?)(?:\.html)?(\?.*?)?(\#.*?)?$/, "https://proceedings.mlr.press/$1/$2/$2.pdf"], [/^.*:\/\/openaccess\.thecvf\.com\/(.*?)\/html\/(.*?)\.html(\?.*?)?(\#.*?)?$/, "https://openaccess.thecvf.com/$1/papers/$2.pdf"], [/^.*:\/\/openaccess\.thecvf\.com\/(.*?)\/papers\/(.*?)\.pdf(\?.*?)?(\#.*?)?$/, "https://openaccess.thecvf.com/$1/html/$2.html"], + [/^.*:\/\/www\.jmlr\.org\/papers\/v(\d+)\/(.*?)\.html(\?.*?)?(\#.*?)?$/, "https://www.jmlr.org/papers/volume$1/$2/$2.pdf"], + [/^.*:\/\/www\.jmlr\.org\/papers\/volume(\d+)\/(.*?)\/(.*?)\.pdf(\?.*?)?(\#.*?)?$/, "https://www.jmlr.org/papers/v$1/$2.html"], ]; // All console logs should start with this prefix. const LOG_PREFIX = "[arXiv-utils]"; diff --git a/firefox/background.js b/firefox/background.js index e015f9e..1edae0d 100644 --- a/firefox/background.js +++ b/firefox/background.js @@ -31,6 +31,8 @@ const TARGET_URL_REGEXP_REPLACE = [ [/^.*:\/\/proceedings\.mlr\.press\/(.*?)\/(.*?)(?:\.html)?(\?.*?)?(\#.*?)?$/, "https://proceedings.mlr.press/$1/$2/$2.pdf"], [/^.*:\/\/openaccess\.thecvf\.com\/(.*?)\/html\/(.*?)\.html(\?.*?)?(\#.*?)?$/, "https://openaccess.thecvf.com/$1/papers/$2.pdf"], [/^.*:\/\/openaccess\.thecvf\.com\/(.*?)\/papers\/(.*?)\.pdf(\?.*?)?(\#.*?)?$/, "https://openaccess.thecvf.com/$1/html/$2.html"], + [/^.*:\/\/www\.jmlr\.org\/papers\/v(\d+)\/(.*?)\.html(\?.*?)?(\#.*?)?$/, "https://www.jmlr.org/papers/volume$1/$2/$2.pdf"], + [/^.*:\/\/www\.jmlr\.org\/papers\/volume(\d+)\/(.*?)\/(.*?)\.pdf(\?.*?)?(\#.*?)?$/, "https://www.jmlr.org/papers/v$1/$2.html"], ]; // All console logs should start with this prefix. const LOG_PREFIX = "[arXiv-utils]"; diff --git a/tests/testcases.yaml b/tests/testcases.yaml index 27cc5ea..1fb3d98 100644 --- a/tests/testcases.yaml +++ b/tests/testcases.yaml @@ -291,6 +291,14 @@ navigation: title: "CVPR 2022 Open Access Repository" url2: https://openaccess.thecvf.com/content/CVPR2022W/VOCVALC/papers/Fu_Coupling_Vision_and_Proprioception_for_Navigation_of_Legged_Robots_CVPRW_2022_paper.pdf description: CVF abs -> pdf (Workshop with slash) +- url: https://www.jmlr.org/papers/v12/pedregosa11a.html + url2: https://www.jmlr.org/papers/volume12/pedregosa11a/pedregosa11a.pdf + title: "Scikit-learn: Machine Learning in Python" + description: JMLR abs -> pdf +- url: https://www.jmlr.org/papers/volume12/pedregosa11a/pedregosa11a.pdf + url2: https://www.jmlr.org/papers/v12/pedregosa11a.html + title: "Scikit-learn: Machine Learning in Python" + description: JMLR pdf -> abs # TODO: Test download filenames: # - Title with colon: https://arxiv.org/abs/2102.07936 # - Title with hash symbol: https://arxiv.org/abs/1611.04717