projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[gameone] simplify playlist extractor
[youtube-dl]
/
youtube_dl
/
extractor
/
nhl.py
diff --git
a/youtube_dl/extractor/nhl.py
b/youtube_dl/extractor/nhl.py
index e8d43dd135ff29bc9471466f66b8b4e1b55eadea..2edd806a3f6aa12792f3c8d8065a57fd2e2e70a1 100644
(file)
--- a/
youtube_dl/extractor/nhl.py
+++ b/
youtube_dl/extractor/nhl.py
@@
-1,6
+1,5
@@
import re
import json
import re
import json
-import xml.etree.ElementTree
from .common import InfoExtractor
from ..utils import (
from .common import InfoExtractor
from ..utils import (
@@
-26,9
+25,8
@@
class NHLBaseInfoExtractor(InfoExtractor):
'path': initial_video_url.replace('.mp4', '_sd.mp4'),
})
path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data
'path': initial_video_url.replace('.mp4', '_sd.mp4'),
})
path_url = 'http://video.nhl.com/videocenter/servlets/encryptvideopath?' + data
- path_
response = self._download_webpage
(path_url, video_id,
+ path_
doc = self._download_xml
(path_url, video_id,
u'Downloading final video url')
u'Downloading final video url')
- path_doc = xml.etree.ElementTree.fromstring(path_response)
video_url = path_doc.find('path').text
join = compat_urlparse.urljoin
video_url = path_doc.find('path').text
join = compat_urlparse.urljoin
@@
-72,7
+70,7
@@
class NHLIE(NHLBaseInfoExtractor):
class NHLVideocenterIE(NHLBaseInfoExtractor):
IE_NAME = u'nhl.com:videocenter'
class NHLVideocenterIE(NHLBaseInfoExtractor):
IE_NAME = u'nhl.com:videocenter'
- IE_DESC = u'
Download the first 12 videos from a
videocenter category'
+ IE_DESC = u'
NHL
videocenter category'
_VALID_URL = r'https?://video\.(?P<team>[^.]*)\.nhl\.com/videocenter/(console\?.*?catid=(?P<catid>[^&]+))?'
@classmethod
_VALID_URL = r'https?://video\.(?P<team>[^.]*)\.nhl\.com/videocenter/(console\?.*?catid=(?P<catid>[^&]+))?'
@classmethod
@@
-90,8
+88,8
@@
class NHLVideocenterIE(NHLBaseInfoExtractor):
r'{statusIndex:0,index:0,.*?id:(.*?),'],
webpage, u'category id')
playlist_title = self._html_search_regex(
r'{statusIndex:0,index:0,.*?id:(.*?),'],
webpage, u'category id')
playlist_title = self._html_search_regex(
- r'
\?catid=%s">(.*?)</a>' % cat_id
,
- webpage, u'playlist title', flags=re.DOTALL)
+ r'
tab0"[^>]*?>(.*?)</td>'
,
+ webpage, u'playlist title', flags=re.DOTALL)
.lower().capitalize()
data = compat_urllib_parse.urlencode({
'cid': cat_id,
data = compat_urllib_parse.urlencode({
'cid': cat_id,