Library to transcribe YouTube videos using Whisper model
Project description
Transcribe YouTube videos using Whisper models
Adopts faster_whisperer, a cTransformer's based model for faster transcription.
Usage
from youscribe import transcribe
transcript = transcribe(url="https://www.youtube.com/watch?v=9bZkp7q19f0")
transcript.text()
Prompting
By default, the video title and description are used as prompts to the transcription model. But you can also specify your own prompt:
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
prompt="Enter prompt here"
)
You can also choose not to include prompt by setting prompt=False.
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
prompt=False
)
Working with WhisperTranscript objects
The transcribe() function, if executed successfully, will return a WhisperTranscript object. You can view the transcript as plain text, SRT-formatted text, or a Python dictionary.
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
prompt=False
)
transcript.text()
transcript.srt()
transcript.json()
transcript.segment
Customise Whisper model
In the transcribe function, you can pass your own custom Whisper model:
from youtescribe import WhisperTranscriber
from youtescribe import models
custom_transcriber = WhisperTranscriber(model_size = models.TINY_EN, cpu_threads=6, device="auto")
transcript = transcribe(
url="https://www.youtube.com/watch?v=9bZkp7q19f0",
transcriber=custom_transcriber
)
transcript.text()
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file youscribe-0.0.3.tar.gz.
File metadata
- Download URL: youscribe-0.0.3.tar.gz
- Upload date:
- Size: 7.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
909d53c1876838d298e68868585570d90fae5a310ddb772ca0c8ac045b8d6d20
|
|
| MD5 |
cd5897f7d1788284b069dc042abfba04
|
|
| BLAKE2b-256 |
497f6b5cb1d2dc3606e8536a33a0da1a99ad4bdfd6bd425c6626e9f9276fc4ce
|
File details
Details for the file youscribe-0.0.3-py3-none-any.whl.
File metadata
- Download URL: youscribe-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b64f879a91c025091ae22e8e6885e09b3cf7c635bf0e4dde5052fcb9e3a5304
|
|
| MD5 |
3b16525e1b58b5e47b3e4cb685321a6d
|
|
| BLAKE2b-256 |
a54c5d189f8ee6211b2a1d06df8604eeb231f34e813e5c57a72f1b58fce54b4d
|