GyuhoLee

[Add] 유튜브 자막을 xml으로 추출(PyTube 사용)

1 +from pytube import YouTube
2 +
3 +video_url = 'https://www.youtube.com/watch?v=Zg3j6anDU6U'
4 +yt = YouTube(video_url)
5 +caption = yt.captions.get_by_language_code('ko')
6 +if(caption == None):
7 + caption = yt.captions.all()[0]
8 +caption.xml_captions()
...\ No newline at end of file ...\ No newline at end of file