Package: wagtail-transcription
Wagtail Transcriptionwagtail-transcriptionis app for Wagtail that allows to create transcriptions for YouTube videos automatically with just few clicks! To create transcription it useAssemblyAiAPI.Standard Installationpip install wagtail-transcriptionInstallation For DevelopementIf you want to install wagtail-transcription to develop it clone this repository to your project. After that runpipinstall-epath_to_wagtail_transcription_core_folderThis will create folder (inside your env lib directory) with json file storing path to wagtail-transcription package. Later setps are the same.After installation addwagtail_transcriptionandnotificationsto your installed apps:Note: Make sure that 'wagtail_transcription' is added before 'wagtail.admin'. Otherwise, administration page will not work properlyINSTALLED_APPS = [
    ...
    'wagtail_transcription',
	'notifications',
	...
]SetUp1. Run migrationsAfter installing wagtail-transcription and adding it to installed apps run migrations:python manage.py migrate2. Add wagtail-transcription urlsAdd following to your project urls.pyfrom django.urls import include, path, re_path
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_TOKENIn your settigns file add 'ASSEMBLY_API_TOKEN' (to get it create Assembly Ai account)ASSEMBLY_API_TOKEN = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'4. Add YouTube Data API tokenIn your settings file addYOUTUBE_DATA_API_KEY. To create one checkofficial documentation.YOUTUBE_DATA_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'5. Forward your localhost (developement)IMPORTANTAfter transcription process endsAssemblyAiwill 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 likelocalltunnel.6. Add BASE_URLIn your settings file add 'BASE_URL = "base_url"' this is used when sending webhook_url forAssemblyAi. In developement you should set it to forward url. If you uselocalltunnelit will be something like this'https://your_subdomain.loca.lt'BASE_URL = "base_url"7. Add DOCUMENTS_GROUP (Optional)In your settings file add 'DOCUMENTS_GROUP = True'  to create menu group from wagtail documents and transcriptionDOCUMENTS_GROUP = TrueUsageIn model that you want to add dynamically generated transcryptionfrom wagtail_transcription.edit_handlers import VideoTranscriptionPanel
from wagtail_transcription.models import Transcription

class YourModel(Orderable, models.Model):
    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_idfield accept only youtube video id (not urls).VideoTranscriptionPaneltakes five arguments:field_name - name of field for video_idtranscription_field - name of transcription fieldcustom_class - class of transcription widgetcustom_css - custom css that will be loaded with transcritpion widgetcustom_js - custom js that will be loaded with transcritpion widgetIMPORTANTYou can only generate a transcript on an existing object, if you try to do this in page creation view you will get an error.CustomizationTo be more comfortable with customization checkoutAssemblyAi DocsAdd custom Transcription Widget class, css and jsIn your VideoTranscriptionPanel addVideoTranscriptionPanel('video_id', transcription_field='transcription', custom_class='custom_transcription', custom_css='app_name/css/custom_transcription.css', custom_js='app_name/js/custom_transcription.js'),Add custom RequestTranscriptionViewIn your settings addREQUEST_TRANSCRIPTION_VIEW = "app_name.module_name.YourRequestTranscriptionView"You can easily overwrite how request to AssemblyAi is send by overwriteing request_audio_transcription methodfrom wagtail_transcription.views import RequestTranscriptionView
class YourRequestTranscriptionView(RequestTranscriptionView):

    def request_audio_transcription(self, audio_url, webhook_url):
        """
		Your awesome request logic
		"""
        return responseAdd custom ReceiveTranscriptionViewIn your settings addRECEIVE_TRANSCRIPTION_VIEW = "app_name.module_name.YourReceiveTranscriptionView"Now you can easily overwrite how request with transcription is processedfrom wagtail_transcription.views import ReceiveTranscriptionView

class YourReceiveTranscriptionView(ReceiveTranscriptionView):

    def process_transcription_response(self, transcription_response, 	video_id, model_instance_str, field_name, transcription_field):
        """
        transcription_response - AssemblyAi response with transcription data 
        video_id - id of youtube video for which transcription was made
        model_instance_str - string that allow to get model instance "app:model_name:instance_id"
        field_name = name of field with video_id
        transcription_field = name of field for transcription
        """
        ...
		Your transcription processing logic here
		...
		super().process_transcription_response(transcription_response, 	video_id, model_instance_str, field_name, transcription_field)