Open gioggino opened 3 years ago
yeah me too
@Ksarqu @gioggino You can use caption = yt.captions['a.en']
instead of caption = yt.captions.get_by_language_code('en')
Code Example ---
from pytube import YouTube
url = "https://www.youtube.com/watch?v=ZtBzWUZbTvA"
yt = YouTube(url)
caption = yt.captions['a.en']
print(caption.xml_captions)
It will print the autogenerated caption in xml format
The problem is causing in the xml_caption_to_srt
method of Caption
class.
I still got this deprecation message, unfortunately, because I following the documentation from Read The Docs https://pytube.io/en/latest/user/captions.html
When I try to download captions, I get this warning every time. That doesn't break the code but makes the console's output confusing for people that don't know.