Skip to content
Snippets Groups Projects
Commit f7d918e7 authored by asadazam93's avatar asadazam93
Browse files

Fixed download txt transcript 500

parent 11e16319
No related merge requests found
......@@ -669,7 +669,8 @@ class Transcript(object):
if output_format == 'txt':
text = json.loads(content)['text']
return HTMLParser().unescape("\n".join(text))
text_without_none = [line if line else '' for line in text]
return HTMLParser().unescape("\n".join(text_without_none))
elif output_format == 'srt':
return generate_srt_from_sjson(json.loads(content), speed=1.0)
......@@ -890,9 +891,6 @@ def get_transcript_from_val(edx_video_id, lang=None, output_format=Transcript.SR
raise NotFoundError(u'Transcript not found for {}, lang: {}'.format(edx_video_id, lang))
transcript_conversion_props = dict(transcript, output_format=output_format)
# Log for EDUCATOR-3928
if edx_video_id == 'MIT6002XT214-V002700':
log.info("Transcript content: %s", transcript_conversion_props.get('content', ''))
transcript = convert_video_transcript(**transcript_conversion_props)
filename = transcript['filename']
content = transcript['content']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment