aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-12-07 11:26:07 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2014-12-07 11:26:07 +0100
commit603c92080fd9923f4a17f9ee67fac99494a92bc7 (patch)
tree6abfa72c725c7d5537ae6b62f3c008a2d196583d /youtube_dl
parent0ef4d4ab7e15833031cd43211a38464a9ab9aa17 (diff)
[nhl] Make sure we add '_sd' before the extension (fixes #4397)
'.replace' would find the first dot in the path.
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/nhl.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/nhl.py b/youtube_dl/extractor/nhl.py
index 0244368e9..b2f40344f 100644
--- a/youtube_dl/extractor/nhl.py
+++ b/youtube_dl/extractor/nhl.py
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
import re
import json
+import os
from .common import InfoExtractor
from ..compat import (
@@ -26,7 +27,8 @@ 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.replace('.', '_sd.', 1)
+ filename, ext = os.path.splitext(parsed_url.path)
+ path = '%s_sd%s' % (filename, ext)
data = compat_urllib_parse.urlencode({
'type': 'fvod',
'path': compat_urlparse.urlunparse(parsed_url[:2] + (path,) + parsed_url[3:])