Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
vlc module error
#1
Getting this error when i run the program below I am trying to play a youtube video: AttributeError: module 'vlc' has no attribute 'Instance'. How do I fix this?

import datetime
import webbrowser
import time
import pafy
import vlc
import cv2

alarmhour = int(input("What hour do you want to wake up?"))
alarmminute = int(input("What minute do you want to wake up?"))
ampm = str(input("am or pm"))

if (ampm == "pm"):
    alarmhour = alarmhour + 12

while (1 == 1):
    if (alarmhour == datetime.datetime.now().hour and
    alarmminute == datetime.datetime.now().minute):
        print("Wake up")
        break

url = "https://www.youtube.com/watch?v=iNpXCzaWW1s"
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()
Reply
#2
Please post complete and unaltered error traceback. It contains valuable debugging info.

I haven't used this package (use it from command line)
There are a bunch of examples here: https://git.videolan.org/?p=vlc/bindings...es;hb=HEAD
Perhaps you can find an answer there.
I took a quick look, and every call to vlc.Instance passes arguments.

Please show complete error trace
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pyhton error there is no PIL module error help! pokeboss235 1 2,907 Feb-22-2018, 03:03 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020