input: from typing import List
  
  
  def extract_youtube_titles(youtube_url: str) -> List[str]:
      """Extract titles of all YouTube videos from a given URL.
      >>> extract_youtube_titles('https://www.youtube.com/user/Thexvid/videos')
      ['Title1', 'Title2', 'Title3']
      >>> extract_youtube_titles('https://www.youtube.com/channel/UCa7xY9XGwhWI_GrFuYKST4w')
      ['ChannelTitle1', 'ChannelTitle2']
      """
      import requests
      import re
  
      r = requests.get(youtube_url)
      titles = re.findall('<a href="/watch\?v=([^"]+)">(.+?)<\/a>', r.content.decode('utf-8'))
  
      return [title[1] for title in titles]
output:     import requests
      import re
  
      r = requests.get(youtube_url)
      titles = re.findall('<a href="/watch\?v=([^"]+)">(.+?)<\/a>', r.content.decode('utf-8'))
  
      return [title[1] for title in titles]