My Coding > Programming language > Python > Python libraries and packages > Pytube module for YouTube manipulations

Pytube module for YouTube manipulations

One of the very amazing Python modules. PyTube. Specially created for work with YouTube. For checking information about YouTybe video and download YouTube videos.

Installation pytube module

To install pytube module, use pip command


pip install pytube

Working example for downloading video

Simplest script to download YouTube video:

You need to import YouTube from pytube library

At the next step, create YouTube object linked to the video of your interest.

When the object is created, take its stream with highest resolution.

And at the last step – download it to your selected directory, current for example.


from pytube import YouTube

yt = YouTube("https://www.youtube.com/watch?v=_yco1ScF_c4")

yd = yt.streams.get_highest_resolution()

yd.download('./')

For more details, go to see the video:


Published: 2022-12-20 23:01:58
Updated: 2022-12-20 23:04:31

Last 10 artitles


9 popular artitles

© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit.