How to write a python script for downloading a video from YouTube and saving it to a directory?

0 votes
I want to download a video from YouTube using a python script and save it to a particular location. How do I do it?
Sep 4, 2019 in Python by Arvind
• 2,980 points
794 views

1 answer to this question.

0 votes

First download pytube using the following code 

pip install pytube

Then download the video using the following

from pytube import YouTube
yt = YouTube("https://www.youtube.com/watch?v=n06H7OcPd-g")
yt = yt.get('mp4','720p')
yt.download('/path/to/download/directory')
answered Sep 4, 2019 by Neel
• 3,010 points

Related Questions In Python

0 votes
2 answers
0 votes
1 answer

How to create and read from a temporary file in Python?

Hi, there is a very simple solution ...READ MORE

answered Jan 29, 2019 in Python by Nymeria
• 3,520 points
338 views
0 votes
4 answers

What is a Tuple in Python and how to use it?

Tuples  are a  Unchanging sequence of values, ...READ MORE

answered Jun 21 in Python by sahil
• 540 points
436 views
0 votes
1 answer

How to have values from a List1 into Columns Names and List 2 Values as Index for an Empty DataFrame

Try like this, it will give you ...READ MORE

answered Jul 10, 2019 in Python by Cherukuri
• 32,490 points
204 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,355 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,004 views
0 votes
1 answer

Is it possible to print all the modules imported in a python script?

Since I am using Python 3.6, I ...READ MORE

answered Jul 3, 2019 in Python by Neel
• 3,010 points
150 views
0 votes
1 answer

Is it possible to print a string and a variable in a single print statement in Python?

This can be done using simple string ...READ MORE

answered Jul 15, 2019 in Python by Neel
• 3,010 points
134 views