본문 바로가기
카테고리 없음

[Python] Youtube Downloader

by sosob 2023. 9. 5.
728x90

유투브 다운로드코드 . 

다음에는 UI 를 입혀보자. 

from pytube import YouTube

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

video_url = 'https://www.youtube.com/watch?v=Ytwyq3xWM4U'
youTube = YouTube(video_url)
video = youTube.streams.filter(progressive=True, file_extension='mp4').first()

vTitle = youTube.title
vRating = youTube.rating
vLength = youTube.length
vViews = youTube.views
vDesc = youTube.description

video.download()

print("vTitle : ",  vTitle);
print("vRating : ",  vRating);
print("vLength : ",  vLength);
print("vViews : ",  vViews);
print("vDesc : ",  vDesc);
728x90