Unverified Commit fc36990a by Mushtaq Ali Committed by GitHub

Merge pull request #132 from edx/mushtaq/fix-no-transcript-file

Fix transcript has no file attached to it
parents 29e9063c 7e74f88e
...@@ -843,11 +843,16 @@ def create_trancript_file(video_id, language_code, file_format, resource_fs, sta ...@@ -843,11 +843,16 @@ def create_trancript_file(video_id, language_code, file_format, resource_fs, sta
language_code=language_code, language_code=language_code,
file_format=file_format file_format=file_format
) )
transcript_data = get_video_transcript_data(video_id, language_code) try:
if transcript_data: transcript_data = get_video_transcript_data(video_id, language_code)
transcript_content = transcript_data['content'] if transcript_data:
with resource_fs.open(transcript_name, 'wb') as f: transcript_content = transcript_data['content']
f.write(transcript_content) with resource_fs.open(transcript_name, 'wb') as f:
f.write(transcript_content)
except Exception:
# Do not raise exception in case no transcript file is found for now.
# TODO: Remove this - EDUCATOR-2173
pass
def create_transcripts_xml(video_id, video_el, resource_fs, static_dir): def create_transcripts_xml(video_id, video_el, resource_fs, static_dir):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment