Compare commits

...

1 commit
main ... master

Author SHA1 Message Date
j
a333d73305 export subtitles 2024-02-01 14:53:01 +01:00

View file

@ -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")