title: When I am trying to get live stream from youtube using opencv and camgear I am getting the following error
body: <p>I want to get the live stream from youtube, and for that, I have used opencv along with the package vidgear. But while running the code, I am getting the following error. I am sure that there is no problem with the URL.</p>
  
  <p>I have tried with pafy and streamlink. Even though both have given the result but after few frames, it was getting stuck and I want sequential frames without any pause.</p>
  
  <pre><code>import cv2
  from vidgear.gears import CamGear
  stream = CamGear(source="https://www.youtube.com/watch?v=VIk_6OuYkSo", y_tube =True,  time_delay=1, logging=True).start() # YouTube Video URL as input
  
  while True:
  
      frame = stream.read()
      if frame is None:
          break
  
      cv2.imshow("Output Frame", frame)
  
  
      key = cv2.waitKey(30) 
  
      if key == ord("q"):
  
          break
  
  cv2.destroyAllWindows()
  stream.stop()
  </code></pre>
  
  <p>Error output ::</p>
  
  <pre><code>'NoneType' object has no attribute 'extension'
  Traceback (most recent call last):
    File "C:\Users\CamfyVision\AppData\Local\Programs\Python\Python36\lib\site-packages\vidgear\gears\camgear.py", line 120, in __init__
      print('Extension: {}'.format(_source.extension))
  AttributeError: 'NoneType' object has no attribute 'extension'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "DronrStream.py", line 4, in &lt;module&gt;
      stream = CamGear(source="https://www.youtube.com/watch?v=VIk_6OuYkSo", y_tube =True,  time_delay=1, logging=True).start() # YouTube Video URL as input
    File "C:\Users\CamfyVision\AppData\Local\Programs\Python\Python36\lib\site-packages\vidgear\gears\camgear.py", line 125, in __init__
      raise ValueError('YouTube Mode is enabled and the input YouTube Url is invalid!')
  ValueError: YouTube Mode is enabled and the input YouTube Url is invalid!
  </code></pre>