Skip to content

Commit

Permalink
[nhl] Make sure we add '_sd' before the extension (fixes #4397)
Browse files Browse the repository at this point in the history
'.replace' would find the first dot in the path.
  • Loading branch information
jaimeMF committed Dec 7, 2014
1 parent 0ef4d4a commit 603c920
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion youtube_dl/extractor/nhl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import re
import json
import os

from .common import InfoExtractor
from ..compat import (
Expand All @@ -26,7 +27,8 @@ def _extract_video(self, info):
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:])
Expand Down

0 comments on commit 603c920

Please sign in to comment.