Download Any Youtube Video with 3 lines of code using python - @ahmadhassan

in #utopian-io6 years ago

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:

  1. Open a browser window and navigate to the Download page for Windows at python.org and download the latest version into your laptop/computer.
  2. Start the installer and install the software as like others. must select the add to path option.

  3. open cmd and write python (if you see like image. python is successfully installed)

  4. write exit() and came out from python.
  5. write pip install pytube (see below image)

  6. Make a folder name youtube and with any other name which you like. 
  7. Make a yt.py file inside folder.

  8. 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 :) ========================================================= 

Sort:  

Congratulations @ahmadhassan! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

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

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.19
TRX 0.19
JST 0.033
BTC 89248.16
ETH 3020.22
USDT 1.00
SBD 2.81