Created
August 9, 2022 12:58
-
-
Save jayzhan211/3b0d703d860482db6a6f2c495b239e6a to your computer and use it in GitHub Desktop.
python-vlc with pafy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pafy | |
import vlc | |
url = 'https://www.youtube.com/watch?v=x1UsJ2Znjk0' | |
video = pafy.new(url) | |
video_best = video.getbest() | |
play_url = video_best.url | |
# print(play_url) | |
m = vlc.MediaPlayer(play_url) | |
m.play() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment