def generate_srt_from_sjson(sjson_subs):
        """
        Generate transcripts from sjson to SubRip (*.srt).

        Arguments:
            sjson_subs (dict): `sjson` subs.

        Returns:
            Subtitles in SRT format.
        """

        output = ''

        equal_len = len(sjson_subs['start']) == len(sjson_subs['end']) == len(sjson_subs['text'])
        if not equal_len:
            return output

        for i in range(len(sjson_subs['start'])):
            item = SubRipItem(
                index=i,
                start=SubRipTime(milliseconds=sjson_subs['start'][i]),
                end=SubRipTime(milliseconds=sjson_subs['end'][i]),
                text=sjson_subs['text'][i]
            )
            output += (six.text_type(item))
            output += '\n'
        return output
def generate_srt_from_sjson ( sjson_subs ) : output = '' equal_len = len ( sjson_subs [ 'start' ] ) == len ( sjson_subs [ 'end' ] ) == len ( sjson_subs [ 'text' ] ) if not equal_len : return output for i in range ( len ( sjson_subs [ 'start' ] ) ) : item = SubRipItem ( index = i , start = SubRipTime ( milliseconds = sjson_subs [ 'start' ] [ i ] ) , end = SubRipTime ( milliseconds = sjson_subs [ 'end' ] [ i ] ) , text = sjson_subs [ 'text' ] [ i ] ) output += ( six . text_type ( item ) ) output += '\n' return output
Generate transcripts from sjson to SubRip (*.srt).

        Arguments:
            sjson_subs (dict): `sjson` subs.

        Returns:
            Subtitles in SRT format.