[nhl] Simplify
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 2 Dec 2014 23:08:26 +0000 (00:08 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Tue, 2 Dec 2014 23:08:26 +0000 (00:08 +0100)
youtube_dl/extractor/nhl.py

index 7d74b110bef50caf6ba29a69f261ccd378c989c2..0244368e954a37715ca8b6b750f88059f999376e 100644 (file)
@@ -26,9 +26,7 @@ class NHLBaseInfoExtractor(InfoExtractor):
         initial_video_url = info['publishPoint']
         if info['formats'] == '1':
             parsed_url = compat_urllib_parse_urlparse(initial_video_url)
-            path = parsed_url.path
-            extension_index = path.rfind('.')
-            path = path[:extension_index] + '_sd' + path[extension_index:]
+            path = parsed_url.path.replace('.', '_sd.', 1)
             data = compat_urllib_parse.urlencode({
                 'type': 'fvod',
                 'path': compat_urlparse.urlunparse(parsed_url[:2] + (path,) + parsed_url[3:])