def METHOD_NAME(request: str) -> str:
    request_lines = request.splitlines()
    # Join the first 5 lines back together
    first_five_lines = '\n'.join(request_lines[:5])
    first_five_lines_lower = first_five_lines.lower()  # lowercase to handle weird image type
    # Regular expression to find URLs that contain 'YouTube' or image links
    url_pattern = re.compile(r'href=[\'"]?(https?://www\.youtube[^\'" >]+)')
    img_pattern = re.compile(r'(?:href|src)=[\'"]?(https?://[^\'" >]+\.(jpg|jpeg|png|gif|svg|bmp|webp))')
    # Find all matches
    youtube_links = url_pattern.findall(first_five_lines)
    img_links = img_pattern.findall(first_five_lines_lower)[0] if img_pattern.findall(first_five_lines_lower) else None
    # If there are image links before YouTube links, return empty string
    if img_links and (not youtube_links or
                      first_five_lines_lower.index(img_links[0]) < first_five_lines.index(youtube_links[0])):
        return ''
    # If there are no YouTube links, still return ''
    if not youtube_links:
        return ''
    # Return the first YouTube link
    return youtube_links[0]