Skip to main content

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


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)

Uploaded Source

Built Distribution

justsubs-0.1.1-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page