An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
How to download You Tube video using Python
Intro
In this post you know about how to download youtube vidoes very easily in only in only four lines of code!!
Save your time watch video!
Requirments
pip install pytube
Pytube: Pytube is a very serious, lightweight, dependency-free Python library (and command-line utility) for downloading YouTube Videos. If You want to know more about pytube take a look of documentaion
Let's code
First import youtube from pytube
from pytube import YouTube
Make a variable and paste the web url link of any video don't use the link which you get click on share button.
youtube = YouTube('https://www.youtube.com/watch?v=2Wb2313oHxc')video = youtube.streams.first()
The streams function is fetch video description, title, thumbnail and all these things but only for download video use first() with streams
Then finally use the download function to download the video and give the directory path where you want to download video
video.download('C:/Users/96650/Desktop/')
The all code look like this!
from pytube import YouTubeyoutube = YouTube('https://www.youtube.com/watch?v=2Wb2313oHxc')video = youtube.streams.first()video.download('C:/Users/96650/Desktop/')
If you still reading here please like my content
Happy coding!
Original Link: https://dev.to/dheerajprogrammer/how-to-download-you-tube-video-using-python-52mp
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To