Commit 7fe675b1 by Alexander Kryklia

Allow uppercase transcripts srt extension.

parent 6d2cd987
...@@ -308,8 +308,9 @@ class TestGenerateSubsFromSource(TestDownloadYoutubeSubs): ...@@ -308,8 +308,9 @@ class TestGenerateSubsFromSource(TestDownloadYoutubeSubs):
""") """)
self.clear_subs_content(youtube_subs) self.clear_subs_content(youtube_subs)
# Check transcripts_utils.TranscriptsGenerationException not thrown # Check transcripts_utils.TranscriptsGenerationException not thrown.
transcripts_utils.generate_subs_from_source(youtube_subs, 'srt', srt_filedata, self.course) # Also checks that uppercase file extensions are supported.
transcripts_utils.generate_subs_from_source(youtube_subs, 'SRT', srt_filedata, self.course)
# Check assets status after importing subtitles. # Check assets status after importing subtitles.
for subs_id in youtube_subs.values(): for subs_id in youtube_subs.values():
......
...@@ -213,7 +213,7 @@ def generate_subs_from_source(speed_subs, subs_type, subs_filedata, item, langua ...@@ -213,7 +213,7 @@ def generate_subs_from_source(speed_subs, subs_type, subs_filedata, item, langua
:returns: True, if all subs are generated and saved successfully. :returns: True, if all subs are generated and saved successfully.
""" """
_ = item.runtime.service(item, "i18n").ugettext _ = item.runtime.service(item, "i18n").ugettext
if subs_type != 'srt': if subs_type.lower() != 'srt':
raise TranscriptsGenerationException(_("We support only SubRip (*.srt) transcripts format.")) raise TranscriptsGenerationException(_("We support only SubRip (*.srt) transcripts format."))
try: try:
srt_subs_obj = SubRipFile.from_string(subs_filedata) srt_subs_obj = SubRipFile.from_string(subs_filedata)
......
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