Skip to content

Commit c33840f

Browse files
committed
Allow extra path in figshare URLs
Copied from jupyterhub/binderhub@1d818e9
1 parent 2f1914d commit c33840f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

repo2docker/contentproviders/figshare.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self):
3939
}
4040
]
4141

42-
url_regex = re.compile(r"(.*)/articles/([^/]+)/(\d+)(/)?(\d+)?")
42+
url_regex = re.compile(r"(.*)/articles/([^/]+)/([^/]+)/(\d+)(/)?(\d+)?")
4343

4444
def detect(self, doi, ref=None, extra_args=None):
4545
"""Trigger this provider for things that resolve to a Figshare article"""
@@ -53,8 +53,8 @@ def detect(self, doi, ref=None, extra_args=None):
5353
if any([url.startswith(s) for s in host["hostname"]]):
5454
match = self.url_regex.match(url)
5555
if match:
56-
self.article_id = match.groups()[2]
57-
self.article_version = match.groups()[4]
56+
self.article_id = match.groups()[3]
57+
self.article_version = match.groups()[5]
5858
if not self.article_version:
5959
self.article_version = "1"
6060
return {

0 commit comments

Comments
 (0)