12 lines
459 B
Python
12 lines
459 B
Python
"""Stable identities from publisher-owned metadata self-links."""
|
|
import re
|
|
from urllib.parse import urlsplit
|
|
|
|
|
|
def mlsys_id(url):
|
|
parsed = urlsplit(url)
|
|
if parsed.scheme not in ('https', 'http') or parsed.netloc != 'proceedings.mlsys.org':
|
|
return None
|
|
match = re.fullmatch(r'/paper(?:_files/paper)?/((?:19|20)\d{2})/hash/([a-f0-9]{32})-Abstract(?:-Conference)?\.html', parsed.path)
|
|
return match[1] + '/' + match[2] if match else None
|