This repository has been archived on 2025-01-27. You can view files and clone it, but cannot push or open issues or pull requests.
wot_stats_server/wotstats/lib/__init__.py
2017-08-27 04:45:13 +03:00

11 lines
278 B
Python

import re
def parse_wargaming_openid_url(url):
"""
>>> parse_wargaming_openid_url('https://ru.wargaming.net/id/69552613-CrazyPants1999/')
('69552613', 'CrazyPants1999')
"""
pattern = '^https?.*id\/([0-9]+)-(\w+)\/$'
return re.findall(pattern, url)[0]