projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[ebaumsworld] Remove spurious determine_ext
[youtube-dl]
/
youtube_dl
/
extractor
/
ntv.py
diff --git
a/youtube_dl/extractor/ntv.py
b/youtube_dl/extractor/ntv.py
index dfbcb792ca607c45f05d8183b0791bee8782ec80..ed60314eca4f918392da7fe2637e47ed3cdf5ee9 100644
(file)
--- a/
youtube_dl/extractor/ntv.py
+++ b/
youtube_dl/extractor/ntv.py
@@
-5,7
+5,6
@@
import re
from .common import InfoExtractor
from ..utils import (
from .common import InfoExtractor
from ..utils import (
- ExtractorError,
unescapeHTML
)
unescapeHTML
)
@@
-24,9
+23,9
@@
class NTVIE(InfoExtractor):
'duration': 136,
},
'params': {
'duration': 136,
},
'params': {
-
# rtmp download
-
'skip_download': True,
-
},
+ # rtmp download
+ 'skip_download': True,
+ },
},
{
'url': 'http://www.ntv.ru/video/novosti/750370/',
},
{
'url': 'http://www.ntv.ru/video/novosti/750370/',
@@
-38,9
+37,9
@@
class NTVIE(InfoExtractor):
'duration': 172,
},
'params': {
'duration': 172,
},
'params': {
-
# rtmp download
-
'skip_download': True,
-
},
+ # rtmp download
+ 'skip_download': True,
+ },
},
{
'url': 'http://www.ntv.ru/peredacha/segodnya/m23700/o232416',
},
{
'url': 'http://www.ntv.ru/peredacha/segodnya/m23700/o232416',
@@
-52,9
+51,9
@@
class NTVIE(InfoExtractor):
'duration': 1496,
},
'params': {
'duration': 1496,
},
'params': {
-
# rtmp download
-
'skip_download': True,
-
},
+ # rtmp download
+ 'skip_download': True,
+ },
},
{
'url': 'http://www.ntv.ru/kino/Koma_film',
},
{
'url': 'http://www.ntv.ru/kino/Koma_film',
@@
-66,9
+65,9
@@
class NTVIE(InfoExtractor):
'duration': 5592,
},
'params': {
'duration': 5592,
},
'params': {
-
# rtmp download
-
'skip_download': True,
-
},
+ # rtmp download
+ 'skip_download': True,
+ },
},
{
'url': 'http://www.ntv.ru/serial/Delo_vrachey/m31760/o233916/',
},
{
'url': 'http://www.ntv.ru/serial/Delo_vrachey/m31760/o233916/',
@@
-80,33
+79,25
@@
class NTVIE(InfoExtractor):
'duration': 2590,
},
'params': {
'duration': 2590,
},
'params': {
-
# rtmp download
-
'skip_download': True,
-
},
+ # rtmp download
+ 'skip_download': True,
+ },
},
]
_VIDEO_ID_REGEXES = [
r'<meta property="og:url" content="http://www\.ntv\.ru/video/(\d+)',
r'<video embed=[^>]+><id>(\d+)</id>',
},
]
_VIDEO_ID_REGEXES = [
r'<meta property="og:url" content="http://www\.ntv\.ru/video/(\d+)',
r'<video embed=[^>]+><id>(\d+)</id>',
- r'<video restriction[^>]+><key>(\d+)</key>'
+ r'<video restriction[^>]+><key>(\d+)</key>'
,
]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('id')
- page = self._download_webpage(url, video_id, 'Downloading page')
-
- for pattern in self._VIDEO_ID_REGEXES:
- mobj = re.search(pattern, page)
- if mobj:
- break
-
- if not mobj:
- raise ExtractorError('No media links available for %s' % video_id)
+ page = self._download_webpage(url, video_id)
- video_id =
mobj.group(1
)
+ video_id =
self._html_search_regex(self._VIDEO_ID_REGEXES, page, 'video id'
)
player = self._download_xml('http://www.ntv.ru/vi%s/' % video_id, video_id, 'Downloading video XML')
title = unescapeHTML(player.find('./data/title').text)
player = self._download_xml('http://www.ntv.ru/vi%s/' % video_id, video_id, 'Downloading video XML')
title = unescapeHTML(player.find('./data/title').text)
@@
-124,7
+115,7
@@
class NTVIE(InfoExtractor):
'7': 'video2',
}
'7': 'video2',
}
- app = apps
[puid22] if puid22 in apps else apps['4']
+ app = apps
.get(puid22, apps['4'])
formats = []
for format_id in ['', 'hi', 'webm']:
formats = []
for format_id in ['', 'hi', 'webm']: