Skip to main content

YouTube Subtitles Fetcher

YouTube Subtitles Fetcher is a command-line tool that retrieves subtitles (with optional translations) from YouTube videos. This tool is ideal for quickly extracting YouTube transcripts with support for multiple languages.

Features

  • Fetches subtitles for a given YouTube video URL
  • Supports translations into a specified language (if available)
  • Command-line interface for easy integration into scripts or workflows

Installation

First, install the package via pip:

pip install ytb2subtitles

Usage

Use the command-line tool to fetch subtitles by providing a YouTube URL and optionally, a language code.

Command-Line Example

To retrieve subtitles from a YouTube video:

ytb2subtitles https://www.youtube.com/watch?v=example_video_id

To retrieve subtitles in a specific language:

ytb2subtitles https://www.youtube.com/watch?v=example_video_id --language en

Code Example

You can also import this tool as a module in your Python code:

from ytb2subtitles import get_subtitles

url = "https://www.youtube.com/watch?v=example_video_id" subtitles = get_subtitles(url, lang="en") print(subtitles)

Command-Line Arguments

•	url (required): The YouTube video URL.
•	--language or --lang (optional): The language code for subtitles (default is the original language).

Requirements

•	Python 3.x
•	pytube
•	youtube-transcript-api

Contributing

We welcome contributions! If you find a bug or have an idea for a feature, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Metadata

Release files for ytb2subtitles 2024.10.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ytb2subtitles 2024.10.27
File Size Uploaded Provenance Actions
ytb2subtitles-2024.10.27.tar.gz 3.2 kB Without provenance Details for ytb2subtitles-2024.10.27.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ytb2subtitles 2024.10.27
File Interpreter ABI Platform Actions
ytb2subtitles-2024.10.27-py3-none-any.whl Python 3 none any Details for ytb2subtitles-2024.10.27-py3-none-any.whl

Total release size: 6.6 kB

Release files / ytb2subtitles-2024.10.27.tar.gz

Download URL ytb2subtitles-2024.10.27.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b824e017615d7be73f97a6d48205b87459312d8a24aeba42c9767736a1e26fae
BLAKE2b-256 checksum
How to use checksums
dbca291b01ddb2b8cef7e2bac9eb3e202388fed7371cabcaa2f63c0d3320c26c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.10

Release files / ytb2subtitles-2024.10.27-py3-none-any.whl

Download URL ytb2subtitles-2024.10.27-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff35ab4bfc8a4297a6351cf4f08f83107e022bbff6f856ef8641f11a120b4689
BLAKE2b-256 checksum
How to use checksums
3340a3f20a62e8a7df2078325f360bd3815e93585608d5079003abe4f3c7ba41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.10

Security for ytb2subtitles 2024.10.27

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page