Download YouTube videos By Python in 5 lines !!!

Pre-requisites

Let’s Begin

video.py

audio.py

$ touch video.py audio.py
$ pip install pafy youtube.dl
from pafy import new
url = input("Enter the url: ")
video = new(url)
dl = video.getbest()
dl.download()
$ py video.py
from pafy import new
url = input("Enter the link: ")
video = new(url)
audio = video.audiostreams
audio[0].download()

--

--

--

someone likes CLI/TUI apps, automation, server-sides, and backend.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Machinesets and Auto-scaling OpenShift Cluster

Eclipse Equinoxe OSGi Console Command Execution

Confident Testing: Why Unit-Testing Over Integration-Testing

Code Contributions to WebKit (release 0.3 for DPS911)

How To Create an App in 5 Easy Steps

Top 10 Features in Salesforce Winter ’20 Release Notes

Salesforce winter 20 release note.

GraphQL playground

Using ARKit on iOS to Build an Augmented Reality Shooter Game

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abdfnabd

Abdfnabd

someone likes CLI/TUI apps, automation, server-sides, and backend.

More from Medium

Python — How to Read Files

Efficient summation in Python

8 Reasons Why You Should Consider Learning Python Today