url_2.py 345 B

12345678
  1. def archive_topic_url(site_url, html_root, sanitized_stream_name, sanitized_topic_name):
  2. """
  3. http://127.0.0.1:4000/archive/stream/213222-general/topic/newstreams.html
  4. """
  5. base_url = urllib.parse.urljoin(site_url, html_root)
  6. return (
  7. f"{base_url}/stream/{sanitized_stream_name}/topic/{sanitized_topic_name}.html"
  8. )