def captionsToSRT()

in translate_captions/captions_helper.py [0:0]


    def captionsToSRT(self, captions):
        srt = ''

        index = 1

        for caption in captions:
            srt += str(index) + '\n'
            srt += self.formatTimeSRT(float(caption["start"])) + ' --> ' + self.formatTimeSRT(float(caption["end"])) + '\n'
            srt += caption["caption"] + '\n\n'
            index += 1

        return srt.rstrip()