Skip to content

Commit

Permalink
Change regex to match new(?) figshare URL scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
betatim committed Jan 6, 2021
1 parent b35ec4e commit 1d818e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions binderhub/repoproviders.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class FigshareProvider(RepoProvider):
Users must provide a spec consisting of the Figshare DOI.
"""
name = Unicode("Figshare")
url_regex = re.compile(r"(.*)/articles/([^/]+)/(\d+)(/)?(\d+)?")
url_regex = re.compile(r"(.*)/articles/([^/]+)/([^/]+)/(\d+)(/)?(\d+)?")

async def get_resolved_ref(self):
client = AsyncHTTPClient()
Expand All @@ -258,8 +258,8 @@ async def get_resolved_ref(self):
r = await client.fetch(req)

match = self.url_regex.match(r.effective_url)
article_id = match.groups()[2]
article_version = match.groups()[4]
article_id = match.groups()[3]
article_version = match.groups()[5]
if not article_version:
article_version = "1"
self.record_id = "{}.v{}".format(article_id, article_version)
Expand Down

0 comments on commit 1d818e9

Please sign in to comment.