input: Write a function to extract all YouTube video titles from a given URL. The function should return a list of these titles. If the URL is invalid or no titles are found, 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/user/NonExistentUser/videos") == []
  assert extract_youtube_titles("invalid_url") == []
  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()
      except:
          return []
      
      soup = BeautifulSoup(response.text, 'html.parser')
      titles = soup.find_all('a', {'class': 'yt-simple-endpoint style-scope ytd-grid-video-renderer'})
      
      return [title.get('title') for title in titles if title.get('title')]
  