Skip to main content

🦜 Youtube to Audio by Andrew A Levin

Project description

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.

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

ytb2subtitles-0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

ytb2subtitles-0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file ytb2subtitles-0.1.tar.gz.

File metadata

  • Download URL: ytb2subtitles-0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.10

File hashes

Hashes for ytb2subtitles-0.1.tar.gz
Algorithm Hash digest
SHA256 c45de0aa5a9c93d2ce49945343e16aebbab7602a9cf2c4402ae567f0c0f489b4
MD5 c27bc28176567914401f3e22a278d3c6
BLAKE2b-256 34e3de27c5c9b299607ede46f8b851d052af4594dbd8ae6d8b7de0dc977b7653

See more details on using hashes here.

File details

Details for the file ytb2subtitles-0.1-py3-none-any.whl.

File metadata

  • Download URL: ytb2subtitles-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.10

File hashes

Hashes for ytb2subtitles-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ee6abbc5804147bdbcbf9912b5f74a6d43fa16227674fbe38d37e81f669d5f6
MD5 2c555d2f6ecf5cc651be387e30a2c58d
BLAKE2b-256 9f4959085356b6385c0e7d9e24f4da01f373c52e07c48a237988633f935b8a97

See more details on using hashes here.

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