Skip to content

Commit 1d818e9

Browse files
committed
Change regex to match new(?) figshare URL scheme
1 parent b35ec4e commit 1d818e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

binderhub/repoproviders.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ class FigshareProvider(RepoProvider):
249249
Users must provide a spec consisting of the Figshare DOI.
250250
"""
251251
name = Unicode("Figshare")
252-
url_regex = re.compile(r"(.*)/articles/([^/]+)/(\d+)(/)?(\d+)?")
252+
url_regex = re.compile(r"(.*)/articles/([^/]+)/([^/]+)/(\d+)(/)?(\d+)?")
253253

254254
async def get_resolved_ref(self):
255255
client = AsyncHTTPClient()
@@ -258,8 +258,8 @@ async def get_resolved_ref(self):
258258
r = await client.fetch(req)
259259

260260
match = self.url_regex.match(r.effective_url)
261-
article_id = match.groups()[2]
262-
article_version = match.groups()[4]
261+
article_id = match.groups()[3]
262+
article_version = match.groups()[5]
263263
if not article_version:
264264
article_version = "1"
265265
self.record_id = "{}.v{}".format(article_id, article_version)

0 commit comments

Comments
 (0)