projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Credit @ossi96 for dhm (#5305)
[youtube-dl]
/
youtube_dl
/
extractor
/
npo.py
diff --git
a/youtube_dl/extractor/npo.py
b/youtube_dl/extractor/npo.py
index c075618e84cb8181e27c2a9dc3cc033a16d5dea4..5d84485714b9f360d47c8676710e9c3e6d9578c7 100644
(file)
--- a/
youtube_dl/extractor/npo.py
+++ b/
youtube_dl/extractor/npo.py
@@
-1,6
+1,5
@@
from __future__ import unicode_literals
from __future__ import unicode_literals
-from .subtitles import SubtitlesInfoExtractor
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
from .common import InfoExtractor
from ..utils import (
fix_xml_ampersands,
@@
-12,7
+11,7
@@
from ..utils import (
)
)
-class NPOBaseIE(
Subtitles
InfoExtractor):
+class NPOBaseIE(InfoExtractor):
def _get_token(self, video_id):
token_page = self._download_webpage(
'http://ida.omroep.nl/npoplayer/i.js',
def _get_token(self, video_id):
token_page = self._download_webpage(
'http://ida.omroep.nl/npoplayer/i.js',
@@
-164,13
+163,10
@@
class NPOIE(NPOBaseIE):
subtitles = {}
if metadata.get('tt888') == 'ja':
subtitles = {}
if metadata.get('tt888') == 'ja':
- subtitles['nl'] = 'http://e.omroep.nl/tt888/%s' % video_id
-
- if self._downloader.params.get('listsubtitles', False):
- self._list_available_subtitles(video_id, subtitles)
- return
-
- subtitles = self.extract_subtitles(video_id, subtitles)
+ subtitles['nl'] = [{
+ 'ext': 'vtt',
+ 'url': 'http://e.omroep.nl/tt888/%s' % video_id,
+ }]
return {
'id': video_id,
return {
'id': video_id,
@@
-223,7
+219,8
@@
class NPOLiveIE(NPOBaseIE):
if streams:
for stream in streams:
stream_type = stream.get('type').lower()
if streams:
for stream in streams:
stream_type = stream.get('type').lower()
- if stream_type == 'ss':
+ # smooth streaming is not supported
+ if stream_type in ['ss', 'ms']:
continue
stream_info = self._download_json(
'http://ida.omroep.nl/aapi/?stream=%s&token=%s&type=jsonp'
continue
stream_info = self._download_json(
'http://ida.omroep.nl/aapi/?stream=%s&token=%s&type=jsonp'
@@
-234,7
+231,10
@@
class NPOLiveIE(NPOBaseIE):
stream_url = self._download_json(
stream_info['stream'], display_id,
'Downloading %s URL' % stream_type,
stream_url = self._download_json(
stream_info['stream'], display_id,
'Downloading %s URL' % stream_type,
- transform_source=strip_jsonp)
+ 'Unable to download %s URL' % stream_type,
+ transform_source=strip_jsonp, fatal=False)
+ if not stream_url:
+ continue
if stream_type == 'hds':
f4m_formats = self._extract_f4m_formats(stream_url, display_id)
# f4m downloader downloads only piece of live stream
if stream_type == 'hds':
f4m_formats = self._extract_f4m_formats(stream_url, display_id)
# f4m downloader downloads only piece of live stream
@@
-246,6
+246,7
@@
class NPOLiveIE(NPOBaseIE):
else:
formats.append({
'url': stream_url,
else:
formats.append({
'url': stream_url,
+ 'preference': -10,
})
self._sort_formats(formats)
})
self._sort_formats(formats)