input: Write a function to extract the titles of all YouTube videos from a given URL. If the URL is valid and contains video titles, it should return a list of video titles. If the URL is invalid or no titles are found, it should return an empty list. Additionally, if the request to the URL fails, it should return an error message indicating the failure.
  assert extract_video_titles("https://www.youtube.com/user/Thexvid/videos")==["Video Title 1", "Video Title 2", "Video Title 3"]
  assert extract_video_titles("https://invalidurl.com")==[]
  assert extract_video_titles("https://www.youtube.com/user/NoVideosHere/videos")==[]
  assert extract_video_titles("https://www.youtube.com/channel/InvalidChannel/videos")==[]
output: import requests
  from bs4 import BeautifulSoup
  
  def extract_video_titles(url):
      try:
          response = requests.get(url)
          response.raise_for_status()
      except requests.RequestException as e:
          return str(e)
      
      soup = BeautifulSoup(response.text, 'html.parser')
      titles = [title.text for title in soup.find_all('a', class_='yt-simple-endpoint style-scope ytd-grid-video-renderer')]
      
      return titles