diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-02-08 17:36:32 +0000 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2019-02-08 17:36:32 +0000 |
| commit | 157924514877b470b7e7bc10a789ffb54441fd1f (patch) | |
| tree | 59115483323851126542ed4873353d43e120f598 /arxiv2remarkable.py | |
| parent | If pdf file supplied, use that as rM filename (diff) | |
| download | paper2remarkable-157924514877b470b7e7bc10a789ffb54441fd1f.tar.gz paper2remarkable-157924514877b470b7e7bc10a789ffb54441fd1f.zip | |
Update for older arXiv urls
Diffstat (limited to 'arxiv2remarkable.py')
| -rwxr-xr-x | arxiv2remarkable.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arxiv2remarkable.py b/arxiv2remarkable.py index 8c7b0ea..bd62776 100755 --- a/arxiv2remarkable.py +++ b/arxiv2remarkable.py @@ -63,17 +63,17 @@ def validate_url(url): False """ m = re.match( - "https?://arxiv.org/(abs|pdf)/\d{4}\.\d{5}(v\d+)?(\.pdf)?", url + "https?://arxiv.org/(abs|pdf)/\d{4}\.\d{4,5}(v\d+)?(\.pdf)?", url ) return not m is None def get_urls(url): """Get the pdf and abs url from any given url """ - if re.match("https?://arxiv.org/abs/\d{4}\.\d{5}(v\d+)?", url): + if re.match("https?://arxiv.org/abs/\d{4}\.\d{4,5}(v\d+)?", url): abs_url = url pdf_url = url.replace("abs", "pdf") + ".pdf" - elif re.match("https?://arxiv.org/pdf/\d{4}\.\d{5}(v\d+)?\.pdf", url): + elif re.match("https?://arxiv.org/pdf/\d{4}\.\d{4,5}(v\d+)?\.pdf", url): abs_url = url[:-4].replace("pdf", "abs") pdf_url = url else: |
