diff --git a/common/lib/xmodule/xmodule/video_module/video_module.py b/common/lib/xmodule/xmodule/video_module/video_module.py index 3b5bcfac2e..c2067cc026 100644 --- a/common/lib/xmodule/xmodule/video_module/video_module.py +++ b/common/lib/xmodule/xmodule/video_module/video_module.py @@ -43,6 +43,7 @@ from .video_utils import create_youtube_string from xmodule.modulestore.inheritance import InheritanceKeyValueStore from xblock.runtime import KvsFieldData +from urlparse import urlparse log = logging.getLogger(__name__) @@ -253,7 +254,8 @@ class VideoModule(VideoFields, XModule): track_url = None transcript_download_format = self.transcript_download_format - get_ext = lambda filename: filename.rpartition('.')[-1] + # Prevent incorrectly parsing urls like 'http://abc.com/path/video.mp4?xxxx'. + get_ext = lambda filename: urlparse(filename).path.rpartition('.')[-1] sources = {get_ext(src): src for src in self.html5_sources} if self.download_video: