def extract_video_id_from_yturl(href):
    """ Extract a Youtube video id from a given URL
        Returns None on error or failure.
    """
    video_id = None

    try:
        start = -1
        if href.find('youtube.com/watch') != -1:
            start = href.find('v=') + 2
        elif href.find('youtu.be/') != -1:
            start = href.find('be/') + 3

        if start == -1:
            return None

        video_id = href[start:start + 11]

        return video_id

    except Exception:
        return None