I'm trying to play a random youtube video using pafy and vlc. But when I'm executing the script :
import vlc
import cv2
url = "Youtube_URL"
video = pafy.new(url)
best = video.getbest()
playurl = best.url
ins = vlc.Instance()
player = ins.media_player_new()
Media = ins.media_new(playurl)
Media.get_mrl()
player.set_media(Media)
player.play()
I'm getting below error :
AttributeError: 'module' object has no attribute 'Instance'
I've tried a lot but vlc.Instance() is not working, I don't know why. I will appreciate any help/inputs.