title: how to check a YouTube video exist in the directory or not by providing the link of the video using python?
body: <p><strong>How to write a program, Suppose you are downloading a YouTube playlist which contains some number of videos but due to some network issue downloading got failed and a few videos downloaded and few not so how to write a program that will check whether the video exists in the directory if it is then it will skip if not then download the video?</strong></p>
  <pre><code>import os
  from pytube import YouTube, Playlist
  from pytube.cli import on_progress
  
  def Downloader(str):
      url = YouTube(str, on_progress_callback=on_progress)
      video = url.streams.get_highest_resolution()
      video.download('D:\YouTube\Yash Raj Mukhate')   # Here we give the download location
      print('\nDownloaded successfully')
  
  
  link = input('Please Give the link: ')
  playlist = Playlist(link)
  print('Number of videos in playlist: %s' % len(playlist.video_urls))
  for video_url in playlist.video_urls:
      video_name = YouTube(video_url).title
      if os.path.exists(f'D:\YouTube\Yash Raj Mukhate{video_name}.mp4'):
          print('File Exist')
      else:
          print('File does not exist)
  </code></pre>