Showing
1 changed file
with
8 additions
and
0 deletions
src/subtitle.py
0 → 100644
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 |
-
Please register or login to post a comment