subtitle.py 237 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 from pytube import YouTube video_url = 'https://www.youtube.com/watch?v=Zg3j6anDU6U' yt = YouTube(video_url) caption = yt.captions.get_by_language_code('ko') if(caption == None): caption = yt.captions.all()[0] caption.xml_captions()