Compare commits

..

No commits in common. '58d7a00e3f07744b65ad53d12fcee1ec0050de74' and '1ca4e686a3f9001cb52c8b682b57c1fba65700db' have entirely different histories.

@ -18,8 +18,8 @@ class NPOIE(InfoExtractor):
'md5': 'f9ce9c43cc8bc3b8138df1562b99c379', 'md5': 'f9ce9c43cc8bc3b8138df1562b99c379',
'info_dict': { 'info_dict': {
'description': 'Wie is de mol? (2)', 'description': 'Wie is de mol? (2)',
'duration': 2439,
'ext': 'm4v', 'ext': 'm4v',
'duration': 2439,
'id': 'wie-is-de-mol-2', 'id': 'wie-is-de-mol-2',
'thumbnail': 'https://assets-start.npo.nl/resources/2023/07/01/e723c3cf-3e42-418a-9ba5-f6dbb64b516a.jpg', 'thumbnail': 'https://assets-start.npo.nl/resources/2023/07/01/e723c3cf-3e42-418a-9ba5-f6dbb64b516a.jpg',
'title': 'Wie is de mol? (2)' 'title': 'Wie is de mol? (2)'
@ -30,7 +30,6 @@ class NPOIE(InfoExtractor):
'info_dict': { 'info_dict': {
'id': 'zwart-geld-de-toekomst-komt-uit-afrika', 'id': 'zwart-geld-de-toekomst-komt-uit-afrika',
'title': 'Zwart geld: de toekomst komt uit Afrika', 'title': 'Zwart geld: de toekomst komt uit Afrika',
'ext': 'mp4',
'description': 'Zwart geld: de toekomst komt uit Afrika', 'description': 'Zwart geld: de toekomst komt uit Afrika',
'thumbnail': 'https://assets-start.npo.nl/resources/2023/06/30/d9879593-1944-4249-990c-1561dac14d8e.jpg', 'thumbnail': 'https://assets-start.npo.nl/resources/2023/06/30/d9879593-1944-4249-990c-1561dac14d8e.jpg',
'duration': 3000 'duration': 3000
@ -71,7 +70,7 @@ class NPOIE(InfoExtractor):
if not product_id: if not product_id:
raise ExtractorError('No productId found for slug: %s' % slug) raise ExtractorError('No productId found for slug: %s' % slug)
formats = self._extract_formats_by_product_id(product_id, slug, url) formats = self._download_by_product_id(product_id, slug, url)
return { return {
'id': slug, 'id': slug,
@ -82,7 +81,7 @@ class NPOIE(InfoExtractor):
'duration': duration, 'duration': duration,
} }
def _extract_formats_by_product_id(self, product_id, slug, url=None): def _download_by_product_id(self, product_id, slug, url=None):
token = self._get_token(product_id) token = self._get_token(product_id)
formats = [] formats = []
for profile in ( for profile in (
@ -94,13 +93,13 @@ class NPOIE(InfoExtractor):
'https://prod.npoplayer.nl/stream-link', video_id=slug, 'https://prod.npoplayer.nl/stream-link', video_id=slug,
data=json.dumps({ data=json.dumps({
'profileName': profile, 'profileName': profile,
'drmType': 'widevine',
'referrerUrl': url or '', 'referrerUrl': url or '',
}).encode('utf8'), }).encode('utf8'),
headers={ headers={
'Authorization': token, 'Authorization': token,
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}, }
fatal=False,
) )
stream_url = stream_link.get('stream', {}).get('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))
@ -117,8 +116,7 @@ class BNNVaraIE(NPOIE):
'info_dict': { 'info_dict': {
'id': 'VARA_101369808', 'id': 'VARA_101369808',
'thumbnail': 'https://media.vara.nl/files/thumbnails/321291_custom_zembla__wie_is_de_mol_680x383.jpg', 'thumbnail': 'https://media.vara.nl/files/thumbnails/321291_custom_zembla__wie_is_de_mol_680x383.jpg',
'title': 'Zembla - Wie is de mol?', 'title': 'Zembla - Wie is de mol?'
'ext': 'mp4',
} }
}] }]
@ -143,7 +141,7 @@ class BNNVaraIE(NPOIE):
}) })
product_id = media.get('data', {}).get('player', {}).get('pomsProductId') product_id = media.get('data', {}).get('player', {}).get('pomsProductId')
formats = self._extract_formats_by_product_id(product_id, video_id) formats = self._download_by_product_id(product_id, video_id)
return { return {
'id': product_id, 'id': product_id,
@ -171,7 +169,7 @@ class ONIE(NPOIE):
results = re.findall("page: '(.+)'", page) results = re.findall("page: '(.+)'", page)
formats = [] formats = []
for result in results: for result in results:
formats.extend(self._extract_formats_by_product_id(result, video_id)) formats.extend(self._download_by_product_id(result, video_id))
if not formats: if not formats:
raise ExtractorError('Could not find a POMS product id in the provided URL, ' raise ExtractorError('Could not find a POMS product id in the provided URL, '
@ -190,18 +188,14 @@ class ZAPPIE(NPOIE):
_VALID_URL = r'https?://(?:www\.)?zapp.nl/.*' _VALID_URL = r'https?://(?:www\.)?zapp.nl/.*'
_TESTS = [{ _TESTS = [{
'url': 'https://www.zapp.nl/programmas/zappsport/gemist/POMS_AT_811523', 'url': 'https://www.zapp.nl/programmas/zappsport/gemist/AT_300003973',
'md5': '9eb2d8b6f88b72b6b986ea2c26a81588', # TODO fill in other test attributes
'info_dict': {
'id': 'POMS_AT_811523',
'title': 'POMS_AT_811523',
},
}] }]
def _real_extract(self, url): def _real_extract(self, url):
video_id = url.rstrip('/').split('/')[-1] video_id = url.rstrip('/').split('/')[-1]
formats = self._extract_formats_by_product_id(video_id, video_id, url=url) formats = self._download_by_product_id(url, video_id)
return { return {
'id': video_id, 'id': video_id,
@ -240,7 +234,7 @@ class SchoolTVIE(NPOIE):
metadata = self._download_json(metadata_url, metadata = self._download_json(metadata_url,
video_id).get('pageProps', {}).get('data', {}) video_id).get('pageProps', {}).get('data', {})
formats = self._extract_formats_by_product_id(metadata.get('poms_mid'), video_id) formats = self._download_by_product_id(metadata.get('poms_mid'), video_id)
if not formats: if not formats:
raise ExtractorError('Could not find a POMS product id in the provided URL, ' raise ExtractorError('Could not find a POMS product id in the provided URL, '
@ -262,7 +256,7 @@ class NTRSubsiteIE(NPOIE):
results = re.findall(r'data-mid="(.+_.+)"', page) results = re.findall(r'data-mid="(.+_.+)"', page)
formats = [] formats = []
for result in results: for result in results:
formats.extend(self._extract_formats_by_product_id(result, video_id)) formats.extend(self._download_by_product_id(result, video_id))
break break
if not formats: if not formats:
@ -285,8 +279,8 @@ class HetKlokhuisIE(NTRSubsiteIE):
'md5': '4664b54ed4e05183b1e4f2f4290d551e', 'md5': '4664b54ed4e05183b1e4f2f4290d551e',
'info_dict': { 'info_dict': {
'id': 'aliens', 'id': 'aliens',
'title': 'aliens', 'title': 'aliens'
}, }
}] }]
@ -301,7 +295,7 @@ class VPROIE(NPOIE):
'id': 'offline-als-luxe.html', 'id': 'offline-als-luxe.html',
'title': 'offline-als-luxe.html', 'title': 'offline-als-luxe.html',
'ext': 'm4v', 'ext': 'm4v',
}, }
}] }]
def _real_extract(self, url): def _real_extract(self, url):
@ -310,7 +304,7 @@ class VPROIE(NPOIE):
results = re.findall(r'data-media-id="(.+_.+)"\s', page) results = re.findall(r'data-media-id="(.+_.+)"\s', page)
formats = [] formats = []
for result in results: for result in results:
formats.extend(self._extract_formats_by_product_id(result, video_id)) formats.extend(self._download_by_product_id(result, video_id))
break # TODO find a better solution, VPRO pages can have multiple videos embedded break # TODO find a better solution, VPRO pages can have multiple videos embedded
if not formats: if not formats:
@ -333,6 +327,6 @@ class AndereTijdenIE(NTRSubsiteIE):
'md5': '3d607b16e00b459156b4ab6e163dccd7', 'md5': '3d607b16e00b459156b4ab6e163dccd7',
'info_dict': { 'info_dict': {
'id': 'Duitse-soldaten-over-de-Slag-bij-Arnhem', 'id': 'Duitse-soldaten-over-de-Slag-bij-Arnhem',
'title': 'Duitse-soldaten-over-de-Slag-bij-Arnhem', 'title': 'Duitse-soldaten-over-de-Slag-bij-Arnhem'
}, }
}] }]

Loading…
Cancel
Save