X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fnhl.py;h=2a84f676150afb9f93a52bef68557ea5ac7bd54f;hb=ea2ee40357eb2c43f8968a4eeba47e1cf97667ba;hp=d66c2c6f833852a0143cda250f724222c69207d5;hpb=f889cea109b4e2647e3fd6a462c9893b88b21e04;p=youtube-dl diff --git a/youtube_dl/extractor/nhl.py b/youtube_dl/extractor/nhl.py index d66c2c6f8..2a84f6761 100644 --- a/youtube_dl/extractor/nhl.py +++ b/youtube_dl/extractor/nhl.py @@ -4,10 +4,11 @@ import re import json from .common import InfoExtractor -from ..utils import ( +from ..compat import ( compat_urlparse, compat_urllib_parse, - determine_ext, +) +from ..utils import ( unified_strdate, ) @@ -32,7 +33,7 @@ class NHLBaseInfoExtractor(InfoExtractor): path_url, video_id, 'Downloading final video url') video_url = path_doc.find('path').text else: - video_url = initial_video_url + video_url = initial_video_url join = compat_urlparse.urljoin return { @@ -89,7 +90,7 @@ class NHLIE(NHLBaseInfoExtractor): class NHLVideocenterIE(NHLBaseInfoExtractor): IE_NAME = 'nhl.com:videocenter' IE_DESC = 'NHL videocenter category' - _VALID_URL = r'https?://video\.(?P[^.]*)\.nhl\.com/videocenter/(console\?.*?catid=(?P[0-9]+)(?![&?]id=).*?)?$' + _VALID_URL = r'https?://video\.(?P[^.]*)\.nhl\.com/videocenter/(console\?[^(id=)]*catid=(?P[0-9]+)(?![&?]id=).*?)?$' _TEST = { 'url': 'http://video.canucks.nhl.com/videocenter/console?catid=999', 'info_dict': { @@ -123,10 +124,10 @@ class NHLVideocenterIE(NHLBaseInfoExtractor): response = self._download_webpage(request_url, playlist_title) response = self._fix_json(response) if not response.strip(): - self._downloader.report_warning(u'Got an empty reponse, trying ' + self._downloader.report_warning('Got an empty reponse, trying ' 'adding the "newvideos" parameter') response = self._download_webpage(request_url + '&newvideos=true', - playlist_title) + playlist_title) response = self._fix_json(response) videos = json.loads(response)