Download Any Youtube Video with 3 lines of code using python - @ahmadhassan
Today i am going to show a simple and fast way to download any youtube video. This is just beginning method. I will share upgrade version later.
I will also share the way to download a complete YouTube playlist or channel's videos at once.
Let starts:
- Open a browser window and navigate to the Download page for Windows at python.org and download the latest version into your laptop/computer.
- Start the installer and install the software as like others. must select the add to path option.
- open cmd and write python (if you see like image. python is successfully installed)
- write exit() and came out from python.
- write pip install pytube (see below image)
- Make a folder name youtube and with any other name which you like.
- Make a yt.py file inside folder.
- Open the file and cope paste below
from pytube import YouTube
videolink = "youtube video link "
yt = YouTube(videolink).streams.first()
print("Video has been Downloaded Successfully...")
9. Open cmd in folder location.
Type python yt.py (See figure)
Video Has been downloaded Successfully.,,,,,
Note: .stream.first() is used for download high mp4 resolution. i will describe further with more efficient script in next story if you support me.
=========================================================
Thanks for reading and always welcome your suggestions :) =========================================================
Congratulations @ahmadhassan! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP