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

Flutter CI/CD: GitHub Actions vs. Bitrise

Private, Public or Hybrid Cloud: Which One is Proper?

Developing inside a Container

Steps to Merge XML Data in Existing PDF Forms

Adobe Experience Manager

Ultimate Gaming Performance Guide (Maximum FPS Optimizations)

AWS API Gateway as Ingress Controller Advanced settings — Part 02

What is a Beautiful Code?

Agile World S1 E23 with hosts Sabrina C E Bruce and Karl Smith on who created Agile World and what…

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

How to start learning web development with Python

Noobs Guide to Data Types in Python Programming

Introduction to Modern Python or Python 101: Ultimate Python

Python: Basic Goodreads Quotes Scrapper