Information*/알면도움됨

python 유튜브 영상 다운로드 스크립트

ch4rli3kop 2019. 5. 25. 14:30
반응형

python 유튜브 영상 다운로드 스크립트



유튜브에서 동영상을 다운로드 받을 수 있는 방법은 흔히 많이들 사용하는 video converter 사이트를 이용하는 방법이 있지만, 프로그래머스러운 방법을 찾아보았다. 물론 저작권에 대한 책임은 유의하시길 바란다.

여기서 소개할 방법은 PyTube라는 python 모듈을 사용하여 다운로드를 받을 수 있는 방법이다.

다음 글들을 참고하였다.

https://python-pytube.readthedocs.io/en/latest/index.html https://seolin.tistory.com/89?category=762768 https://seolin.tistory.com/93?category=762768 https://seolin.tistory.com/94?category=762768

해당 영상의 링크를 갖고 다운로드 받을 수 있고, 플레이 리스트에 존재하는 모든 동영상들을 자동으로 다운로드 받는 방법도 존재한다.

from pytube import YouTube
from pytube import Playlist

video = YouTube('...')
video.streams.first().download()

# for i in video.streams.filter(progressive=True ,file_extension='mp4').all():  
#     print(i)

playlist = Playlist('https://www.youtube.com/playlist?list=...')
playlist.download_all()


반응형

'Information* > 알면도움됨' 카테고리의 다른 글

Frida Interceptor.replace  (0) 2019.12.17
Ubuntu 18.04 한글 입력하기  (0) 2019.06.02
online disassembler  (0) 2019.05.15
Chrome css cache 제거하기  (0) 2019.05.03
babel 사용하기 (on WSL)  (0) 2019.05.01