Compare commits

..

1 Commits

Author SHA1 Message Date
Bart Broere
a93dff4424
Merge 179c8b06b6 into c5098961b0 2024-09-11 17:17:03 +00:00

View File

@ -5,7 +5,7 @@ import json
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ExtractorError, join_nonempty, traverse_obj from ..utils import ExtractorError
class NPOIE(InfoExtractor): class NPOIE(InfoExtractor):
@ -95,7 +95,7 @@ class NPOIE(InfoExtractor):
}, },
fatal=False, fatal=False,
) )
stream_url = traverse_obj(stream_link, ('stream', 'streamURL')) stream_url = stream_link.get('stream', {}).get('streamURL')
formats.extend(self._extract_mpd_formats(stream_url, slug, mpd_id='dash', fatal=False)) formats.extend(self._extract_mpd_formats(stream_url, slug, mpd_id='dash', fatal=False))
return formats return formats
@ -140,9 +140,9 @@ class BNNVaraIE(NPOIE):
return { return {
'id': product_id, 'id': product_id,
'title': traverse_obj(media, ('data', 'player', 'title')), 'title': media.get('data', {}).get('player', {}).get('title'),
'formats': formats, 'formats': formats,
'thumbnail': traverse_obj(media, ('data', 'player', 'image', 'url')), 'thumbnail': media.get('data', {}).get('player', {}).get('image').get('url'),
} }
@ -160,7 +160,7 @@ class ONIE(NPOIE):
def _real_extract(self, url): def _real_extract(self, url):
video_id = url.rstrip('/').split('/')[-1] video_id = url.rstrip('/').split('/')[-1]
page = self._download_webpage(url, video_id) page, _ = self._download_webpage_handle(url, video_id)
results = re.findall("page: '(.+)'", page) results = re.findall("page: '(.+)'", page)
formats = [] formats = []
for result in results: for result in results:
@ -241,7 +241,7 @@ class SchoolTVIE(NPOIE):
return { return {
'id': video_id, 'id': video_id,
'title': join_nonempty('title', 'subtitle', from_dict=metadata), 'title': metadata.get('title', '') + ' - ' + metadata.get('subtitle', ''),
'description': metadata.get('description') or metadata.get('short_description'), 'description': metadata.get('description') or metadata.get('short_description'),
'formats': formats, 'formats': formats,
} }