EG = "https://www.scss.tcd.ie/elaine.ui.dhonnchadha/comhra/irgl0001.utf8.html"
import re

def get_mp3_url(url):
    return re.sub("/([^\./]*)\.utf8\.html$", "/media/\\1.mp3", url)
get_mp3_url(EG)
'https://www.scss.tcd.ie/elaine.ui.dhonnchadha/comhra/media/irgl0001.mp3'