import re


def extract_music_links(text):
    """Returns an array of music URLs. Currently searches only for YouTube,
    Soundcloud, and Spotify links."""
    m = re.compile(("(https?://)?([a-z0-9.]*?\.)?(youtube.com/|youtu.be/|"
                    "soundcloud.com/|spotify.com/track/)"
                    "([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])"))
    links = m.findall(text)
    links = ["".join(link) for link in links]

    # Turn all URIs into URLs (necessary for the Spotify API).
    return [l if re.match("https?://", l) else "https://" + l for l in links]