def autolinks_simple(url):
 u_url = url.lower()
 if (('@' in url) and ('://' not in url)):
  return ('<a href="mailto:%s">%s</a>' % (url, url))
 elif u_url.endswith(('.jpg', '.jpeg', '.gif', '.png')):
  return ('<img src="%s" controls />' % url)
 elif u_url.endswith(('.mp4', '.mpeg', '.mov', '.ogv')):
  return ('<video src="%s" controls></video>' % url)
 elif u_url.endswith(('.mp3', '.wav', '.ogg')):
  return ('<audio src="%s" controls></audio>' % url)
 return ('<a href="%s">%s</a>' % (url, url))

def autolinks_simple ( url ) : u_url = url . lower ( ) if ( ( '@' in url ) and ( '://' not in url ) ) : return ( '<a href="mailto:%s">%s</a>' % ( url , url ) ) elif u_url . endswith ( ( '.jpg' , '.jpeg' , '.gif' , '.png' ) ) : return ( '<img src="%s" controls />' % url ) elif u_url . endswith ( ( '.mp4' , '.mpeg' , '.mov' , '.ogv' ) ) : return ( '<video src="%s" controls></video>' % url ) elif u_url . endswith ( ( '.mp3' , '.wav' , '.ogg' ) ) : return ( '<audio src="%s" controls></audio>' % url ) return ( '<a href="%s">%s</a>' % ( url , url ) )
it automatically converts the url to link .