Download subtitles from YouTube as plain text.
Project description
justsubs
Download subtitles from YouTube as plain text
Based on gist by glasslion.
2024-03-23: Tested on Windows, may fail on Linux.
Install
pip install justsubs
Latest:
git clone https://github.com/epogrebnyak/justsubs.git
cd justsubs
pip install -e .
Usage
1. List subtitle options
from justsubs import Video
video = Video("KzWS7gJX5Z8")
video.list_subs()
From the output above you will need a language slug like
en-uYU-mmqFLq8
as simple en
might not work.
2. Download subtitles
subs = Video("KzWS7gJX5Z8").subtitles(language="en-uYU-mmqFLq8")
subs.download()
3. Print as plain text
print(subs.get_plain_text()[:500])
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
justsubs-0.1.1.tar.gz
(3.0 kB
view hashes)