fork download
  1. from urllib import parse
  2. url = r'htt'+'p://link.ru/123-456/text789/1122-hi-90.html'
  3. print(parse.urlsplit(url).path.rsplit('/')[-1].split('-')[0])
Success #stdin #stdout 0.03s 9692KB
stdin
Standard input is empty
stdout
1122