No project description provided
Project description
Wagtail Transcription
wagtail-transcription is app for Wagtail that allows to create transcriptions for YouTube videos automatically with just few clicks! To create transcription it use AssemblyAi API.
pip install wagtail-transcription
Then add wagtail_transcription
and notifications
to your installed apps:
Note: Make sure that 'wagtail_transcription' is added before 'wagtail.admin'. Otherwise, administration page will not work properly
INSTALLED_APPS = [
...
'wagtail_transcription',
'notifications',
...
]
SetUp
1. Run migrations
After installing wagtail-transcription and adding it to installed apps run migrations:
python manage.py migrate
2. Add wagtail-transcription urls
Add following to your project urls.py
from wagtail_transcription import urls as wagtail_transcription_url
import notifications.urls
urlpatterns = [
...
path("wagtail_transcription/", include(wagtail_transcription_url)),
re_path(r'^inbox/notifications/', include(notifications.urls, namespace='notifications')),
...
]
3. Add ASSEMBLY_API_TOKEN
In your settigns file add 'ASSEMBLY_API_TOKEN' (to get it create Assembly Ai account)
ASSEMBLY_API_TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
4. Forward your localhost (developement)
IMPORTANT After transcription process ends AssemblyAi will send request to one of wagtail-transcription views. To receive it on local server you have to forward your localhost. Best and easiest option is use tunelling service like localltunnel.
5. Add BASE_URL
In your settings file add 'BASE_URL = "base_url"' this is used when sending webhook_url for AssemblyAi. In developement you should set it to forward url. If you use localltunnel it will be something like this 'https://your_subdomain.loca.lt'
BASE_URL = "base_url"
6. Add DOCUMENTS_GROUP (Optional)
In your settings file add 'DOCUMENTS_GROUP = True' to create menu group from wagtail documents and transcription
DOCUMENTS_GROUP = True
Usage
In model that you want to add dynamically generated transcryption
from wagtail_transcription.edit_handlers import VideoTranscriptionPanel
from wagtail_transcription.models import Transcription
class YourModel(Orderable, models.Model):
video_id = video_id = models.CharField(max_length=255, blank=True)
transcription = models.ForeignKey(
Transcription,
null=True,
blank=True,
on_delete=models.SET_NULL,
related_name='+'
)
panels = [
MultiFieldPanel([
VideoTranscriptionPanel('video_id', transcription_field='transcription'),
FieldPanel('transcription'),
], heading="Video and Transcription"),
]
video_id field accept only youtube video id (not urls).
VideoTranscriptionPanel takes two arguments:
- field_name - name of field for video_id
- transcription_field - name of transcription field
IMPORTANT You can only generate a transcript on an existing object, if you try to do this in page creation view you will get an error.
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 Distributions
Hashes for wagtail-transcription-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c36a796c79ce9c2183a3e86f2ec4376a3ce3fc1a568916fb414e28a414945ed |
|
MD5 | f0c5fc913852395d97cf1f13a9d49484 |
|
BLAKE2b-256 | 4b303d22a6cfa6eec61693370bdd79447df996e78dfab22b964c9ffe5b14d8bd |
Hashes for wagtail_transcription-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e87b0795b3ea3847f04aa6781e6a83c52d14ea9c902035908e57e1d249ca2c0 |
|
MD5 | e28185b4321c2ca4dc8ef06e38e013a3 |
|
BLAKE2b-256 | c9c4c78d27f92b0fa32fa810807a758448acab8ef4b345789f21c76d8c04236d |
Hashes for wagtail_transcription-0.0.3-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8047997b96966b6c9d0f2654b671a5095242ecf3c9e5daad1fcd95919d0778af |
|
MD5 | d94c35a08e5c135f78f6107226266806 |
|
BLAKE2b-256 | 4c2dc2b70d2ee6c206dda582512f91b01c3ce81e97336c44b5720920853e7ae5 |