Skip to content

Play a Youtube video using pywhatkit in Python

The playonyt() function in pywhatkit module is used to play a Youtube video either from a URL or from a keyword.


pywhatkit.playonyt("url/keywords", use_api, open_video);

#use_api (optional, val = False) - Use web-API instead.
#open_video (optional, val = True) - Opens video in your browser if set to True.


//Plays Yummy by Justin Bieber


pywhatkit.playonyt("Yummy Justin Bieber");
See also  How to generate random numbers in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.