input: Write a function to extract the titles of all YouTube videos from a given URL. The function should make a request to the YouTube page, parse the HTML content, and return a list of video titles. If the URL is invalid or no titles are found, the function should return an empty list.
  assert extract_youtube_titles("https://www.youtube.com/user/Thexvid/videos")==["Title1", "Title2", "Title3"]
  assert extract_youtube_titles("https://www.youtube.com/invalid_url")==[]
  assert extract_youtube_titles("https://www.youtube.com/valid_url_without_titles")==[]
  assert extract_youtube_titles("")==[]
output: import requests
  from bs4 import BeautifulSoup
  
  def extract_youtube_titles(url):
      try:
          response = requests.get(url)
          response.raise_for_status()
          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
      except:
          return []