We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
NHL.COM URL Failure...
URL:
http://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802 

youtube-dl.py -v http://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', 'http://video.mapleleafs.nhl.com/videocenter/console?id=58665']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2014.12.01
[debug] Python version 2.7.5 - Windows-7-6.1.7601-SP1
[debug] exe versions: ffmpeg N-40824-, rtmpdump 2.4
[debug] Proxy map: {}
[nhl.com] 58665: Downloading JSON metadata
[nhl.com] 58665: Extracting information
[nhl.com] 58665: Downloading final video url
[debug] Invoking downloader on 'http://mapleleafs.cdnllnwnl.neulion.net/s/mapleleafs/vod/flv/LWEB-100128-CLASSICGI6.flv?eid=58653&pid=58665&gid=3028?eid=58653&pid=58665&gid=3028&pt=1&ip=199.85.73.12&e
=1417456874&h=181627b3cec444da4267f94da6b83915'
ERROR: unable to download video data: HTTP Error 404: Not Found
Traceback (most recent call last):
  File "C:\Transmogrifier\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1087, in process_info
    success = dl(filename, info_dict)
  File "C:\Transmogrifier\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1063, in dl
    return fd.download(name, info)
  File "C:\Transmogrifier\youtube-dl.py\youtube_dl\downloader\common.py", line 294, in download
    return self.real_download(filename, info_dict)
  File "C:\Transmogrifier\youtube-dl.py\youtube_dl\downloader\http.py", line 66, in real_download
    data = self.ydl.urlopen(request)
  File "C:\Transmogrifier\youtube-dl.py\youtube_dl\YoutubeDL.py", line 1321, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "C:\Python27\lib\urllib2.py", line 410, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 448, in error
    return self._call_chain(_args)
  File "C:\Python27\lib\urllib2.py", line 382, in _call_chain
    result = func(_args)
  File "C:\Python27\lib\urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found

'catid' is not recognized as an internal or external command,
operable program or batch file.

Thanks in advance..
Ringo


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `youtube_dl/extractor/nhl.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 import re
4 import json
5 
6 from .common import InfoExtractor
7 from ..compat import (
8     compat_urlparse,
9     compat_urllib_parse,
10 )
11 from ..utils import (
12     unified_strdate,
13 )
14 
15 
16 class NHLBaseInfoExtractor(InfoExtractor):
17     @staticmethod
18     def _fix_json(json_string):
19         return json_string.replace('\\\'', '\'')
20 
21     def _extract_video(self, info):
22         video_id = info['id']
23         self.report_extraction(video_id)
24 
25         initial_video_url = info['publishPoint']
26         if info['formats'] == '1':
27             data = compat_urllib_parse.urlencode({
28                 'type': 'fvod',
29                 'path': initial_video_url.replace('.mp4', '_sd.mp4'),
30             })
31             path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data
32             path_doc = self._download_xml(
33                 path_url, video_id, 'Downloading final video url')
34             video_url = path_doc.find('path').text
35         else:
36             video_url = initial_video_url
37 
38         join = compat_urlparse.urljoin
39         return {
40             'id': video_id,
41             'title': info['name'],
42             'url': video_url,
43             'description': info['description'],
44             'duration': int(info['duration']),
45             'thumbnail': join(join(video_url, '/u/'), info['bigImage']),
46             'upload_date': unified_strdate(info['releaseDate'].split('.')[0]),
47         }
48 
49 
50 class NHLIE(NHLBaseInfoExtractor):
51     IE_NAME = 'nhl.com'
52     _VALID_URL = r'https?://video(?P<team>\.[^.]*)?\.nhl\.com/videocenter/console(?:\?(?:.*?[?&])?)id=(?P<id>[0-9a-z-]+)'
53 
54     _TESTS = [{
55         'url': 'http://video.canucks.nhl.com/videocenter/console?catid=6?id=453614',
56         'md5': 'db704a4ea09e8d3988c85e36cc892d09',
57         'info_dict': {
58             'id': '453614',
59             'ext': 'mp4',
60             'title': 'Quick clip: Weise 4-3 goal vs Flames',
61             'description': 'Dale Weise scores his first of the season to put the Canucks up 4-3.',
62             'duration': 18,
63             'upload_date': '20131006',
64         },
65     }, {
66         'url': 'http://video.nhl.com/videocenter/console?id=2014020024-628-h',
67         'md5': 'd22e82bc592f52d37d24b03531ee9696',
68         'info_dict': {
69             'id': '2014020024-628-h',
70             'ext': 'mp4',
71             'title': 'Alex Galchenyuk Goal on Ray Emery (14:40/3rd)',
72             'description': 'Home broadcast - Montreal Canadiens at Philadelphia Flyers - October 11, 2014',
73             'duration': 0,
74             'upload_date': '20141011',
75         },
76     }, {
77         'url': 'http://video.flames.nhl.com/videocenter/console?id=630616',
78         'only_matching': True,
79     }]
80 
81     def _real_extract(self, url):
82         mobj = re.match(self._VALID_URL, url)
83         video_id = mobj.group('id')
84         json_url = 'http://video.nhl.com/videocenter/servlets/playlist?ids=%s&format=json' % video_id
85         data = self._download_json(
86             json_url, video_id, transform_source=self._fix_json)
87         return self._extract_video(data[0])
88 
89 
90 class NHLVideocenterIE(NHLBaseInfoExtractor):
91     IE_NAME = 'nhl.com:videocenter'
92     IE_DESC = 'NHL videocenter category'
93     _VALID_URL = r'https?://video\.(?P<team>[^.]*)\.nhl\.com/videocenter/(console\?.*?catid=(?P<catid>[0-9]+)(?![&?]id=).*?)?$'
94     _TEST = {
95         'url': 'http://video.canucks.nhl.com/videocenter/console?catid=999',
96         'info_dict': {
97             'id': '999',
98             'title': 'Highlights',
99         },
100         'playlist_count': 12,
101     }
102 
103     def _real_extract(self, url):
104         mobj = re.match(self._VALID_URL, url)
105         team = mobj.group('team')
106         webpage = self._download_webpage(url, team)
107         cat_id = self._search_regex(
108             [r'var defaultCatId = "(.+?)";',
109              r'{statusIndex:0,index:0,.*?id:(.*?),'],
110             webpage, 'category id')
111         playlist_title = self._html_search_regex(
112             r'tab0"[^>]*?>(.*?)</td>',
113             webpage, 'playlist title', flags=re.DOTALL).lower().capitalize()
114 
115         data = compat_urllib_parse.urlencode({
116             'cid': cat_id,
117             # This is the default value
118             'count': 12,
119             'ptrs': 3,
120             'format': 'json',
121         })
122         path = '/videocenter/servlets/browse?' + data
123         request_url = compat_urlparse.urljoin(url, path)
124         response = self._download_webpage(request_url, playlist_title)
125         response = self._fix_json(response)
126         if not response.strip():
127             self._downloader.report_warning('Got an empty reponse, trying '
128                                             'adding the "newvideos" parameter')
129             response = self._download_webpage(request_url + '&newvideos=true',
130                                               playlist_title)
131             response = self._fix_json(response)
132         videos = json.loads(response)
133 
134         return {
135             '_type': 'playlist',
136             'title': playlist_title,
137             'id': cat_id,
138             'entries': [self._extract_video(v) for v in videos],
139         }
140
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/youtube_dl/extractor/nhl.py b/youtube_dl/extractor/nhl.py
--- a/youtube_dl/extractor/nhl.py
+++ b/youtube_dl/extractor/nhl.py
@@ -7,6 +7,7 @@
 from ..compat import (
     compat_urlparse,
     compat_urllib_parse,
+    compat_urllib_parse_urlparse
 )
 from ..utils import (
     unified_strdate,
@@ -24,9 +25,13 @@
 
         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:]
             data = compat_urllib_parse.urlencode({
                 'type': 'fvod',
-                'path': initial_video_url.replace('.mp4', '_sd.mp4'),
+                'path': compat_urlparse.urlunparse(parsed_url[:2] + (path,) + parsed_url[3:])
             })
             path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data
             path_doc = self._download_xml(
@@ -73,6 +78,17 @@
             'duration': 0,
             'upload_date': '20141011',
         },
+    }, {
+        'url': 'http://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802',
+        'md5': 'c78fc64ea01777e426cfc202b746c825',
+        'info_dict': {
+            'id': '58665',
+            'ext': 'flv',
+            'title': 'Classic Game In Six - April 22, 1979',
+            'description': 'It was the last playoff game for the Leafs in the decade, and the last time the Leafs and Habs played in the playoffs. Great game, not a great ending.',
+            'duration': 400,
+            'upload_date': '20100129'
+        },
     }, {
         'url': 'http://video.flames.nhl.com/videocenter/console?id=630616',
         'only_matching': True,

{"golden_diff": "diff --git a/youtube_dl/extractor/nhl.py b/youtube_dl/extractor/nhl.py\n--- a/youtube_dl/extractor/nhl.py\n+++ b/youtube_dl/extractor/nhl.py\n@@ -7,6 +7,7 @@\n from ..compat import (\n     compat_urlparse,\n     compat_urllib_parse,\n+    compat_urllib_parse_urlparse\n )\n from ..utils import (\n     unified_strdate,\n@@ -24,9 +25,13 @@\n \n         initial_video_url = info['publishPoint']\n         if info['formats'] == '1':\n+            parsed_url = compat_urllib_parse_urlparse(initial_video_url)\n+            path = parsed_url.path\n+            extension_index = path.rfind('.')\n+            path = path[:extension_index] + '_sd' + path[extension_index:]\n             data = compat_urllib_parse.urlencode({\n                 'type': 'fvod',\n-                'path': initial_video_url.replace('.mp4', '_sd.mp4'),\n+                'path': compat_urlparse.urlunparse(parsed_url[:2] + (path,) + parsed_url[3:])\n             })\n             path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data\n             path_doc = self._download_xml(\n@@ -73,6 +78,17 @@\n             'duration': 0,\n             'upload_date': '20141011',\n         },\n+    }, {\n+        'url': 'http://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802',\n+        'md5': 'c78fc64ea01777e426cfc202b746c825',\n+        'info_dict': {\n+            'id': '58665',\n+            'ext': 'flv',\n+            'title': 'Classic Game In Six - April 22, 1979',\n+            'description': 'It was the last playoff game for the Leafs in the decade, and the last time the Leafs and Habs played in the playoffs. Great game, not a great ending.',\n+            'duration': 400,\n+            'upload_date': '20100129'\n+        },\n     }, {\n         'url': 'http://video.flames.nhl.com/videocenter/console?id=630616',\n         'only_matching': True,\n", "issue": "NHL.COM URL Failure...\nURL:\nhttp://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802 \n\nyoutube-dl.py -v http://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802\n[debug] System config: []\n[debug] User config: []\n[debug] Command-line args: ['-v', 'http://video.mapleleafs.nhl.com/videocenter/console?id=58665']\n[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252\n[debug] youtube-dl version 2014.12.01\n[debug] Python version 2.7.5 - Windows-7-6.1.7601-SP1\n[debug] exe versions: ffmpeg N-40824-, rtmpdump 2.4\n[debug] Proxy map: {}\n[nhl.com] 58665: Downloading JSON metadata\n[nhl.com] 58665: Extracting information\n[nhl.com] 58665: Downloading final video url\n[debug] Invoking downloader on 'http://mapleleafs.cdnllnwnl.neulion.net/s/mapleleafs/vod/flv/LWEB-100128-CLASSICGI6.flv?eid=58653&pid=58665&gid=3028?eid=58653&pid=58665&gid=3028&pt=1&ip=199.85.73.12&e\n=1417456874&h=181627b3cec444da4267f94da6b83915'\nERROR: unable to download video data: HTTP Error 404: Not Found\nTraceback (most recent call last):\n  File \"C:\\Transmogrifier\\youtube-dl.py\\youtube_dl\\YoutubeDL.py\", line 1087, in process_info\n    success = dl(filename, info_dict)\n  File \"C:\\Transmogrifier\\youtube-dl.py\\youtube_dl\\YoutubeDL.py\", line 1063, in dl\n    return fd.download(name, info)\n  File \"C:\\Transmogrifier\\youtube-dl.py\\youtube_dl\\downloader\\common.py\", line 294, in download\n    return self.real_download(filename, info_dict)\n  File \"C:\\Transmogrifier\\youtube-dl.py\\youtube_dl\\downloader\\http.py\", line 66, in real_download\n    data = self.ydl.urlopen(request)\n  File \"C:\\Transmogrifier\\youtube-dl.py\\youtube_dl\\YoutubeDL.py\", line 1321, in urlopen\n    return self._opener.open(req, timeout=self._socket_timeout)\n  File \"C:\\Python27\\lib\\urllib2.py\", line 410, in open\n    response = meth(req, response)\n  File \"C:\\Python27\\lib\\urllib2.py\", line 523, in http_response\n    'http', request, response, code, msg, hdrs)\n  File \"C:\\Python27\\lib\\urllib2.py\", line 448, in error\n    return self._call_chain(_args)\n  File \"C:\\Python27\\lib\\urllib2.py\", line 382, in _call_chain\n    result = func(_args)\n  File \"C:\\Python27\\lib\\urllib2.py\", line 531, in http_error_default\n    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)\nHTTPError: HTTP Error 404: Not Found\n\n'catid' is not recognized as an internal or external command,\noperable program or batch file.\n\nThanks in advance..\nRingo\n\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport re\nimport json\n\nfrom .common import InfoExtractor\nfrom ..compat import (\n    compat_urlparse,\n    compat_urllib_parse,\n)\nfrom ..utils import (\n    unified_strdate,\n)\n\n\nclass NHLBaseInfoExtractor(InfoExtractor):\n    @staticmethod\n    def _fix_json(json_string):\n        return json_string.replace('\\\\\\'', '\\'')\n\n    def _extract_video(self, info):\n        video_id = info['id']\n        self.report_extraction(video_id)\n\n        initial_video_url = info['publishPoint']\n        if info['formats'] == '1':\n            data = compat_urllib_parse.urlencode({\n                'type': 'fvod',\n                'path': initial_video_url.replace('.mp4', '_sd.mp4'),\n            })\n            path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data\n            path_doc = self._download_xml(\n                path_url, video_id, 'Downloading final video url')\n            video_url = path_doc.find('path').text\n        else:\n            video_url = initial_video_url\n\n        join = compat_urlparse.urljoin\n        return {\n            'id': video_id,\n            'title': info['name'],\n            'url': video_url,\n            'description': info['description'],\n            'duration': int(info['duration']),\n            'thumbnail': join(join(video_url, '/u/'), info['bigImage']),\n            'upload_date': unified_strdate(info['releaseDate'].split('.')[0]),\n        }\n\n\nclass NHLIE(NHLBaseInfoExtractor):\n    IE_NAME = 'nhl.com'\n    _VALID_URL = r'https?://video(?P<team>\\.[^.]*)?\\.nhl\\.com/videocenter/console(?:\\?(?:.*?[?&])?)id=(?P<id>[0-9a-z-]+)'\n\n    _TESTS = [{\n        'url': 'http://video.canucks.nhl.com/videocenter/console?catid=6?id=453614',\n        'md5': 'db704a4ea09e8d3988c85e36cc892d09',\n        'info_dict': {\n            'id': '453614',\n            'ext': 'mp4',\n            'title': 'Quick clip: Weise 4-3 goal vs Flames',\n            'description': 'Dale Weise scores his first of the season to put the Canucks up 4-3.',\n            'duration': 18,\n            'upload_date': '20131006',\n        },\n    }, {\n        'url': 'http://video.nhl.com/videocenter/console?id=2014020024-628-h',\n        'md5': 'd22e82bc592f52d37d24b03531ee9696',\n        'info_dict': {\n            'id': '2014020024-628-h',\n            'ext': 'mp4',\n            'title': 'Alex Galchenyuk Goal on Ray Emery (14:40/3rd)',\n            'description': 'Home broadcast - Montreal Canadiens at Philadelphia Flyers - October 11, 2014',\n            'duration': 0,\n            'upload_date': '20141011',\n        },\n    }, {\n        'url': 'http://video.flames.nhl.com/videocenter/console?id=630616',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        video_id = mobj.group('id')\n        json_url = 'http://video.nhl.com/videocenter/servlets/playlist?ids=%s&format=json' % video_id\n        data = self._download_json(\n            json_url, video_id, transform_source=self._fix_json)\n        return self._extract_video(data[0])\n\n\nclass NHLVideocenterIE(NHLBaseInfoExtractor):\n    IE_NAME = 'nhl.com:videocenter'\n    IE_DESC = 'NHL videocenter category'\n    _VALID_URL = r'https?://video\\.(?P<team>[^.]*)\\.nhl\\.com/videocenter/(console\\?.*?catid=(?P<catid>[0-9]+)(?![&?]id=).*?)?$'\n    _TEST = {\n        'url': 'http://video.canucks.nhl.com/videocenter/console?catid=999',\n        'info_dict': {\n            'id': '999',\n            'title': 'Highlights',\n        },\n        'playlist_count': 12,\n    }\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        team = mobj.group('team')\n        webpage = self._download_webpage(url, team)\n        cat_id = self._search_regex(\n            [r'var defaultCatId = \"(.+?)\";',\n             r'{statusIndex:0,index:0,.*?id:(.*?),'],\n            webpage, 'category id')\n        playlist_title = self._html_search_regex(\n            r'tab0\"[^>]*?>(.*?)</td>',\n            webpage, 'playlist title', flags=re.DOTALL).lower().capitalize()\n\n        data = compat_urllib_parse.urlencode({\n            'cid': cat_id,\n            # This is the default value\n            'count': 12,\n            'ptrs': 3,\n            'format': 'json',\n        })\n        path = '/videocenter/servlets/browse?' + data\n        request_url = compat_urlparse.urljoin(url, path)\n        response = self._download_webpage(request_url, playlist_title)\n        response = self._fix_json(response)\n        if not response.strip():\n            self._downloader.report_warning('Got an empty reponse, trying '\n                                            'adding the \"newvideos\" parameter')\n            response = self._download_webpage(request_url + '&newvideos=true',\n                                              playlist_title)\n            response = self._fix_json(response)\n        videos = json.loads(response)\n\n        return {\n            '_type': 'playlist',\n            'title': playlist_title,\n            'id': cat_id,\n            'entries': [self._extract_video(v) for v in videos],\n        }\n", "path": "youtube_dl/extractor/nhl.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport re\nimport json\n\nfrom .common import InfoExtractor\nfrom ..compat import (\n    compat_urlparse,\n    compat_urllib_parse,\n    compat_urllib_parse_urlparse\n)\nfrom ..utils import (\n    unified_strdate,\n)\n\n\nclass NHLBaseInfoExtractor(InfoExtractor):\n    @staticmethod\n    def _fix_json(json_string):\n        return json_string.replace('\\\\\\'', '\\'')\n\n    def _extract_video(self, info):\n        video_id = info['id']\n        self.report_extraction(video_id)\n\n        initial_video_url = info['publishPoint']\n        if info['formats'] == '1':\n            parsed_url = compat_urllib_parse_urlparse(initial_video_url)\n            path = parsed_url.path\n            extension_index = path.rfind('.')\n            path = path[:extension_index] + '_sd' + path[extension_index:]\n            data = compat_urllib_parse.urlencode({\n                'type': 'fvod',\n                'path': compat_urlparse.urlunparse(parsed_url[:2] + (path,) + parsed_url[3:])\n            })\n            path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data\n            path_doc = self._download_xml(\n                path_url, video_id, 'Downloading final video url')\n            video_url = path_doc.find('path').text\n        else:\n            video_url = initial_video_url\n\n        join = compat_urlparse.urljoin\n        return {\n            'id': video_id,\n            'title': info['name'],\n            'url': video_url,\n            'description': info['description'],\n            'duration': int(info['duration']),\n            'thumbnail': join(join(video_url, '/u/'), info['bigImage']),\n            'upload_date': unified_strdate(info['releaseDate'].split('.')[0]),\n        }\n\n\nclass NHLIE(NHLBaseInfoExtractor):\n    IE_NAME = 'nhl.com'\n    _VALID_URL = r'https?://video(?P<team>\\.[^.]*)?\\.nhl\\.com/videocenter/console(?:\\?(?:.*?[?&])?)id=(?P<id>[0-9a-z-]+)'\n\n    _TESTS = [{\n        'url': 'http://video.canucks.nhl.com/videocenter/console?catid=6?id=453614',\n        'md5': 'db704a4ea09e8d3988c85e36cc892d09',\n        'info_dict': {\n            'id': '453614',\n            'ext': 'mp4',\n            'title': 'Quick clip: Weise 4-3 goal vs Flames',\n            'description': 'Dale Weise scores his first of the season to put the Canucks up 4-3.',\n            'duration': 18,\n            'upload_date': '20131006',\n        },\n    }, {\n        'url': 'http://video.nhl.com/videocenter/console?id=2014020024-628-h',\n        'md5': 'd22e82bc592f52d37d24b03531ee9696',\n        'info_dict': {\n            'id': '2014020024-628-h',\n            'ext': 'mp4',\n            'title': 'Alex Galchenyuk Goal on Ray Emery (14:40/3rd)',\n            'description': 'Home broadcast - Montreal Canadiens at Philadelphia Flyers - October 11, 2014',\n            'duration': 0,\n            'upload_date': '20141011',\n        },\n    }, {\n        'url': 'http://video.mapleleafs.nhl.com/videocenter/console?id=58665&catid=802',\n        'md5': 'c78fc64ea01777e426cfc202b746c825',\n        'info_dict': {\n            'id': '58665',\n            'ext': 'flv',\n            'title': 'Classic Game In Six - April 22, 1979',\n            'description': 'It was the last playoff game for the Leafs in the decade, and the last time the Leafs and Habs played in the playoffs. Great game, not a great ending.',\n            'duration': 400,\n            'upload_date': '20100129'\n        },\n    }, {\n        'url': 'http://video.flames.nhl.com/videocenter/console?id=630616',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        video_id = mobj.group('id')\n        json_url = 'http://video.nhl.com/videocenter/servlets/playlist?ids=%s&format=json' % video_id\n        data = self._download_json(\n            json_url, video_id, transform_source=self._fix_json)\n        return self._extract_video(data[0])\n\n\nclass NHLVideocenterIE(NHLBaseInfoExtractor):\n    IE_NAME = 'nhl.com:videocenter'\n    IE_DESC = 'NHL videocenter category'\n    _VALID_URL = r'https?://video\\.(?P<team>[^.]*)\\.nhl\\.com/videocenter/(console\\?.*?catid=(?P<catid>[0-9]+)(?![&?]id=).*?)?$'\n    _TEST = {\n        'url': 'http://video.canucks.nhl.com/videocenter/console?catid=999',\n        'info_dict': {\n            'id': '999',\n            'title': 'Highlights',\n        },\n        'playlist_count': 12,\n    }\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        team = mobj.group('team')\n        webpage = self._download_webpage(url, team)\n        cat_id = self._search_regex(\n            [r'var defaultCatId = \"(.+?)\";',\n             r'{statusIndex:0,index:0,.*?id:(.*?),'],\n            webpage, 'category id')\n        playlist_title = self._html_search_regex(\n            r'tab0\"[^>]*?>(.*?)</td>',\n            webpage, 'playlist title', flags=re.DOTALL).lower().capitalize()\n\n        data = compat_urllib_parse.urlencode({\n            'cid': cat_id,\n            # This is the default value\n            'count': 12,\n            'ptrs': 3,\n            'format': 'json',\n        })\n        path = '/videocenter/servlets/browse?' + data\n        request_url = compat_urlparse.urljoin(url, path)\n        response = self._download_webpage(request_url, playlist_title)\n        response = self._fix_json(response)\n        if not response.strip():\n            self._downloader.report_warning('Got an empty reponse, trying '\n                                            'adding the \"newvideos\" parameter')\n            response = self._download_webpage(request_url + '&newvideos=true',\n                                              playlist_title)\n            response = self._fix_json(response)\n        videos = json.loads(response)\n\n        return {\n            '_type': 'playlist',\n            'title': playlist_title,\n            'id': cat_id,\n            'entries': [self._extract_video(v) for v in videos],\n        }\n", "path": "youtube_dl/extractor/nhl.py"}]}