Pytubefix

Latest version: v8.12.3

Safety actively analyzes 723445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 17 of 18

1.5.0

Release Note:

- exceptions improvements

- contribution by ([callumosborne](https://github.com/callumosborne)) ([6#](https://github.com/JuanBindez/pytubefix/pull/6/commits/92931d7886af7a7222e8aa8ea3a652fa1989c6f0))

1.4.1

Release Notes:

- performance improvements

- fixed another problem with video titles.

1.3.0

Release Notes:

- added method to save subtitles in txt file in captions.py


python

def save_captions(self, filename: str):
"""Generate and save "SubRip Subtitle" captions to a text file.

Takes the xml captions from :meth:`~pytubefix.Caption.xml_captions` and
recompiles them into the "SubRip Subtitle" format and saves it to a text file.

:param filename: The name of the file to save the captions.
"""
srt_captions = self.xml_caption_to_srt(self.xml_captions)

with open(filename, 'w', encoding='utf-8') as file:
file.write(srt_captions)



Usage:


python

from pytubefix import YouTube


yt = YouTube('http://youtube.com/watch?v=2lAe1cqCOXo')

caption = yt.captions.get_by_language_code('en')
caption.save_captions("captions.txt")

1.2.0

Release Notes:

- performance improvements

1.1.2

Release Note:

Bugfix:

- Fix AttributeError: 'NoneType' object has no attribute 'span'

1.1.1

Release Note:

cli improvements

Bugfix:

fixed issue affecting Innertube ([1](https://github.com/JuanBindez/pytubefix/pull/1/commits/a99e9e7df485744e4047b414f6f5880dfda945ca))

Contributor:

[ElsevarAsadov](https://github.com/ElsevarAsadov)

Page 17 of 18

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.