[xhamster] use determine_ext
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 23 Aug 2013 15:23:34 +0000 (17:23 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 23 Aug 2013 15:23:34 +0000 (17:23 +0200)
youtube_dl/extractor/xhamster.py

index 0fd0775834fe607cfe08259bda3d78b74c73fe3a..88b8b6be09f7a8f892db8266b3e68df14e22bfe7 100644 (file)
@@ -4,6 +4,7 @@ from .common import InfoExtractor
 from ..utils import (
     compat_urllib_parse,
     unescapeHTML,
+    determine_ext,
     ExtractorError,
 )
 
@@ -36,7 +37,6 @@ class XHamsterIE(InfoExtractor):
             video_url = compat_urllib_parse.unquote(mobj.group('file'))
         else:
             video_url = mobj.group('server')+'/key='+mobj.group('file')
-        video_extension = video_url.split('.')[-1].split('?')[0]
 
         video_title = self._html_search_regex(r'<title>(?P<title>.+?) - xHamster\.com</title>',
             webpage, u'title')
@@ -64,7 +64,7 @@ class XHamsterIE(InfoExtractor):
         return [{
             'id':       video_id,
             'url':      video_url,
-            'ext':      video_extension,
+            'ext':      determine_ext(video_url),
             'title':    video_title,
             'description': video_description,
             'upload_date': video_upload_date,