'Returns transcript, filename and MIME type.
transcripts (dict): A dict with all transcripts and a sub.
Raises:
- NotFoundError if cannot find transcript file in storage.
- ValueError if transcript file is empty or incorrect JSON.
- KeyError if transcript file has incorrect format.
If language is \'en\', self.sub should be correct subtitles name.
If language is \'en\', but if self.sub is not defined, this means that we
should search for video name in order to get proper transcript (old style courses).
If language is not \'en\', give back transcript in proper language and format.'

def get_transcript(self, transcripts, transcript_format='srt', lang=None):

    if (not lang):
        lang = self.get_default_transcript_language(transcripts)
    (sub, other_lang) = (transcripts['sub'], transcripts['transcripts'])
    if (lang == 'en'):
        if sub:
            transcript_name = sub
        elif self.youtube_id_1_0:
            transcript_name = self.youtube_id_1_0
        else:
            log.debug("No    subtitles    for    'en'    language")
            raise ValueError
        data = Transcript.asset(self.location, transcript_name, lang).data
        filename = u'{}.{}'.format(transcript_name, transcript_format)
        content = Transcript.convert(data, 'sjson', transcript_format)
    else:
        data = Transcript.asset(self.location, None, None, other_lang[lang]).data
        filename = u'{}.{}'.format(os.path.splitext(other_lang[lang])[0], transcript_format)
        content = Transcript.convert(data, 'srt', transcript_format)
    if (not content):
        log.debug('no    subtitles    produced    in    get_transcript')
        raise ValueError
    return (content, filename, Transcript.mime_types[transcript_format])
