Downlaod Youtube Video in Any Format Using Python Pytube Library
Hi Everyone, In this Post, We learn How we can Download Youtube Video in Any Format Using Python Pytube Library. We need to install the Python Pytube Library for Downloading Any Youtube Video.
We Complete this program with a few Steps,
- Import Pytube Library
- Get Youtube URL from User Input
- Print All Possible Format
- Input Path Where Save the Video
Complete Program
#import Library
from pytube import YouTube
print("Enter Youtube video url : ")
url = input()
print('Please Wait till a minute....')
yt = YouTube(url)
videos = yt.streams.all()
s = 1
for v in videos:
print(str(s)+ ". "+str(v))
s += 1
print("Enter the number of the video: ")
n = int(input())
vid = videos[n-1]
print("Enter the destination Path Where You want to save this File : ")
destination = input()
print('Please Wait till a minute....')
vid.download(destination)
print("\nYour File has been successfully downloaded")
1. [Stream: itag="18" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.42001E" acodec="mp4a.40.2" progressive="True" type="video"]
2. [Stream: itag="137" mime_type="video/mp4" res="1080p" fps="30fps" vcodec="avc1.640028" progressive="False" type="video"]
3. [Stream: itag="248" mime_type="video/webm" res="1080p" fps="30fps" vcodec="vp9" progressive="False" type="video"]
4. [Stream: itag="136" mime_type="video/mp4" res="720p" fps="30fps" vcodec="avc1.4d401f" progressive="False" type="video"]
5. [Stream: itag="247" mime_type="video/webm" res="720p" fps="30fps" vcodec="vp9" progressive="False" type="video"]
6. [Stream: itag="135" mime_type="video/mp4" res="480p" fps="30fps" vcodec="avc1.4d401e" progressive="False" type="video"]
7. [Stream: itag="244" mime_type="video/webm" res="480p" fps="30fps" vcodec="vp9" progressive="False" type="video"]
8. [Stream: itag="134" mime_type="video/mp4" res="360p" fps="30fps" vcodec="avc1.4d401e" progressive="False" type="video"]
9. [Stream: itag="243" mime_type="video/webm" res="360p" fps="30fps" vcodec="vp9" progressive="False" type="video"]
10. [Stream: itag="133" mime_type="video/mp4" res="240p" fps="30fps" vcodec="avc1.4d4015" progressive="False" type="video"]
11. [Stream: itag="242" mime_type="video/webm" res="240p" fps="30fps" vcodec="vp9" progressive="False" type="video"]
12. [Stream: itag="160" mime_type="video/mp4" res="144p" fps="30fps" vcodec="avc1.4d400c" progressive="False" type="video"]
13. [Stream: itag="278" mime_type="video/webm" res="144p" fps="30fps" vcodec="vp9" progressive="False" type="video"]
14. [Stream: itag="140" mime_type="audio/mp4" abr="128kbps" acodec="mp4a.40.2" progressive="False" type="audio"]
15. [Stream: itag="249" mime_type="audio/webm" abr="50kbps" acodec="opus" progressive="False" type="audio"]
16. [Stream: itag="250" mime_type="audio/webm" abr="70kbps" acodec="opus" progressive="False" type="audio"]
17. [Stream: itag="251" mime_type="audio/webm" abr="160kbps" acodec="opus" progressive="False" type="audio"]- First Enter Url Of Youtube Video
- Select the Number Which format you Want to Download
- Enter Path of Your Computer Where you want to Save this Video then wait till a Minte Your Video is Downloaded
Thanks for Reading Share this Post
Random Blogs
- 10 Awesome Data Science Blogs To Check Out
- AI & Space Exploration – AI’s Role in Deep Space Missions and Planetary Research
- Understanding HTAP Databases: Bridging Transactions and Analytics
- Datasets for analyze in Tableau
- Understanding OLTP vs OLAP Databases: How SQL Handles Query Optimization
- Create Virtual Host for Nginx on Ubuntu (For Yii2 Basic & Advanced Templates)
- How to Start Your Career as a DevOps Engineer
- How to Install Tableau and Power BI on Ubuntu Using VirtualBox
- Extract RGB Color From a Image Using CV2
- SQL Joins Explained: A Complete Guide with Examples
Prepare for Interview
- JavaScript Interview Questions for 5+ Years Experience
- JavaScript Interview Questions for 2–5 Years Experience
- JavaScript Interview Questions for 1–2 Years Experience
- JavaScript Interview Questions for 0–1 Year Experience
- JavaScript Interview Questions For Fresher
- SQL Interview Questions for 5+ Years Experience
- SQL Interview Questions for 2–5 Years Experience
- SQL Interview Questions for 1–2 Years Experience
- SQL Interview Questions for 0–1 Year Experience
- SQL Interview Questions for Freshers
- Design Patterns in Python
Datasets for Machine Learning
- Awesome-ChatGPT-Prompts
- Amazon Product Reviews Dataset
- Ozone Level Detection Dataset
- Bank Transaction Fraud Detection
- YouTube Trending Video Dataset (updated daily)
- Covid-19 Case Surveillance Public Use Dataset
- US Election 2020
- Forest Fires Dataset
- Mobile Robots Dataset
- Safety Helmet Detection
- All Space Missions from 1957
- OSIC Pulmonary Fibrosis Progression Dataset
- Wine Quality Dataset
- Google Audio Dataset
- Iris flower dataset
- Artificial Characters Dataset
- Bitcoin Heist Ransomware Address Dataset




