https://github.com/atahanuz/yt2text
Extract text from a YouTube video in a single command, using OpenAi's Whisper speech recognition model.
https://github.com/atahanuz/yt2text
artificial-intelligence python text-extraction transcription whisper whisper-ai youtube
Last synced: 5 months ago
JSON representation
Extract text from a YouTube video in a single command, using OpenAi's Whisper speech recognition model.
- Host: GitHub
- URL: https://github.com/atahanuz/yt2text
- Owner: atahanuz
- Created: 2023-11-02T11:30:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-13T20:28:46.000Z (almost 2 years ago)
- Last Synced: 2025-04-25T14:08:39.621Z (6 months ago)
- Topics: artificial-intelligence, python, text-extraction, transcription, whisper, whisper-ai, youtube
- Homepage: https://pypi.org/project/yt2text/
- Size: 10.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yt2text
Python library for extracting text from a YouTube video in a single command, using OpenAi's Whisper speech recognition model. It doesn't use disk, performs everything in memory.
https://pypi.org/project/yt2text/
### Installation:
```
pip install yt2text
```
Whisper requires **ffmpeg** to be installed in your computer. Check Whisper's requirements
https://github.com/openai/whisper#setup### Usage:
You'll only interact with the get_text function. It takes a YouTube URL as an argument and returns the text as a string.
```python
import yt2texttext = yt2text.get_text("https://www.youtube.com/watch?v=fLeJJPxua3E")
print(text)
```### Optional Arguments:
**model**:
Set Whisper model (tiny,base,small,medium or large). Check here for details:
https://github.com/openai/whisper#available-models-and-languagesDefaults to "base" which should be good enough for most cases.
The first time you use a model, it will be downloaded first.**verbose**
Set True to print each step of the process. Defaults to False, it only prints if there is an error.### Usage with optional arguments
```python
import yt2texttext = yt2text.get_text("https://www.youtube.com/watch?v=fLeJJPxua3E", model="medium", verbose=True)
print(text)
```## Contact
Raise an Issue in this Github repo (preferred, it sends a notification to my phone)
Or mail me at atahanuz23@gmail.com