diff --git a/management/commands/export_subtitles.py b/management/commands/export_subtitles.py new file mode 100644 index 0000000..1807fbb --- /dev/null +++ b/management/commands/export_subtitles.py @@ -0,0 +1,25 @@ +import json +import os +import subprocess + +from django.core.management.base import BaseCommand +from django.conf import settings + + +class Command(BaseCommand): + help = 'export all subtitles for translations' + + def add_arguments(self, parser): + pass + + def handle(self, **options): + + import annotation.models + import item.models + for i in item.models.Item.objects.filter(data__type__contains='Voice Over').order_by('sort__title'): + print("## %s %s" % (i.get("title"), i.public_id)) + for sub in i.annotations.all().filter(layer='subtitles').exclude(value='').order_by("start"): + if not sub.languages: + print(sub.value.strip() + "\n") + print("\n\n\n") +