Merge pull request #19898 from edx/asad/educator-3928-fix-transcript-txt-500
Fixed download txt transcript 500
This commit is contained in:
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user