fork download
  1. from urllib.parse import urlparse
  2. o = urlparse("https://a...content-available-to-author-only...a.net:666/api/v1/")
  3. print(o.hostname)
  4. s = o.hostname.split('.', 1)[0]
  5. print(s)
Success #stdin #stdout 0.02s 9664KB
stdin
Standard input is empty
stdout
ahostnamea.net
ahostnamea