def METHOD_NAME(line, sites):
    """Expand the links in the line for the given sites."""
    try:
        l = line.strip()
        msg_format, links = find_links(l)
        args = tuple(follow_redirects(l, sites) for l in links)
        line = msg_format % args
    except Exception as e:
        try:
            err("expanding line %s failed due to %s" % (line, unicode(e)))
        except:
            pass
    return line