MichaelK
0
Q:

download youtube video in python

from __future__ import unicode_literals
import youtube_dl

ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
    ydl.download(['VideoURL'])
4
# run python -m pip install git+https://github.com/nficano/pytube
# VERY IMPORTANT, IT WILL NOT WORK IF YOU DON'T RUN THAT

import pytube

url = 'https://www.youtube.com/YoutubeLinkGoesHere'
video = pytube.YouTube(url)
stream = video.streams.get_by_itag(22)
stream.download(filename='video')
1
>>> from pytube import YouTube
>>> YouTube('http://youtube.com/watch?v=9bZkp7q19f0').streams.first().download()
-3
print("Hello World")
-1
from pytube import YouTube #pip install pytube3
yt=YouTube(YouTubeVideoLink)
stream=yt.streams.first()
stream.download()
-3

New to Communities?

Join the community