mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-08-07 03:04:14 +09:00
Compare commits
No commits in common. "58d7a00e3f07744b65ad53d12fcee1ec0050de74" and "1ca4e686a3f9001cb52c8b682b57c1fba65700db" have entirely different histories.
58d7a00e3f
...
1ca4e686a3
@ -18,8 +18,8 @@ class NPOIE(InfoExtractor):
|
||||
'md5': 'f9ce9c43cc8bc3b8138df1562b99c379',
|
||||
'info_dict': {
|
||||
'description': 'Wie is de mol? (2)',
|
||||
'duration': 2439,
|
||||
'ext': 'm4v',
|
||||
'duration': 2439,
|
||||
'id': 'wie-is-de-mol-2',
|
||||
'thumbnail': 'https://assets-start.npo.nl/resources/2023/07/01/e723c3cf-3e42-418a-9ba5-f6dbb64b516a.jpg',
|
||||
'title': 'Wie is de mol? (2)'
|
||||
@ -30,7 +30,6 @@ class NPOIE(InfoExtractor):
|
||||
'info_dict': {
|
||||
'id': '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',
|
||||
'thumbnail': 'https://assets-start.npo.nl/resources/2023/06/30/d9879593-1944-4249-990c-1561dac14d8e.jpg',
|
||||
'duration': 3000
|
||||
@ -71,7 +70,7 @@ class NPOIE(InfoExtractor):
|
||||
if not product_id:
|
||||
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 {
|
||||
'id': slug,
|
||||
@ -82,7 +81,7 @@ class NPOIE(InfoExtractor):
|
||||
'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)
|
||||
formats = []
|
||||
for profile in (
|
||||
@ -94,13 +93,13 @@ class NPOIE(InfoExtractor):
|
||||
'https://prod.npoplayer.nl/stream-link', video_id=slug,
|
||||
data=json.dumps({
|
||||
'profileName': profile,
|
||||
'drmType': 'widevine',
|
||||
'referrerUrl': url or '',
|
||||
}).encode('utf8'),
|
||||
headers={
|
||||
'Authorization': token,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
fatal=False,
|
||||
}
|
||||
)
|
||||
stream_url = stream_link.get('stream', {}).get('streamURL')
|
||||
formats.extend(self._extract_mpd_formats(stream_url, slug, mpd_id='dash', fatal=False))
|
||||
@ -117,8 +116,7 @@ class BNNVaraIE(NPOIE):
|
||||
'info_dict': {
|
||||
'id': 'VARA_101369808',
|
||||
'thumbnail': 'https://media.vara.nl/files/thumbnails/321291_custom_zembla__wie_is_de_mol_680x383.jpg',
|
||||
'title': 'Zembla - Wie is de mol?',
|
||||
'ext': 'mp4',
|
||||
'title': 'Zembla - Wie is de mol?'
|
||||
}
|
||||
}]
|
||||
|
||||
@ -143,7 +141,7 @@ class BNNVaraIE(NPOIE):
|
||||
})
|
||||
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 {
|
||||
'id': product_id,
|
||||
@ -171,7 +169,7 @@ class ONIE(NPOIE):
|
||||
results = re.findall("page: '(.+)'", page)
|
||||
formats = []
|
||||
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:
|
||||
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/.*'
|
||||
|
||||
_TESTS = [{
|
||||
'url': 'https://www.zapp.nl/programmas/zappsport/gemist/POMS_AT_811523',
|
||||
'md5': '9eb2d8b6f88b72b6b986ea2c26a81588',
|
||||
'info_dict': {
|
||||
'id': 'POMS_AT_811523',
|
||||
'title': 'POMS_AT_811523',
|
||||
},
|
||||
'url': 'https://www.zapp.nl/programmas/zappsport/gemist/AT_300003973',
|
||||
# TODO fill in other test attributes
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
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 {
|
||||
'id': video_id,
|
||||
@ -240,7 +234,7 @@ class SchoolTVIE(NPOIE):
|
||||
metadata = self._download_json(metadata_url,
|
||||
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:
|
||||
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)
|
||||
formats = []
|
||||
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
|
||||
|
||||
if not formats:
|
||||
@ -285,8 +279,8 @@ class HetKlokhuisIE(NTRSubsiteIE):
|
||||
'md5': '4664b54ed4e05183b1e4f2f4290d551e',
|
||||
'info_dict': {
|
||||
'id': 'aliens',
|
||||
'title': 'aliens',
|
||||
},
|
||||
'title': 'aliens'
|
||||
}
|
||||
}]
|
||||
|
||||
|
||||
@ -301,7 +295,7 @@ class VPROIE(NPOIE):
|
||||
'id': 'offline-als-luxe.html',
|
||||
'title': 'offline-als-luxe.html',
|
||||
'ext': 'm4v',
|
||||
},
|
||||
}
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
@ -310,7 +304,7 @@ class VPROIE(NPOIE):
|
||||
results = re.findall(r'data-media-id="(.+_.+)"\s', page)
|
||||
formats = []
|
||||
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
|
||||
|
||||
if not formats:
|
||||
@ -333,6 +327,6 @@ class AndereTijdenIE(NTRSubsiteIE):
|
||||
'md5': '3d607b16e00b459156b4ab6e163dccd7',
|
||||
'info_dict': {
|
||||
'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…
x
Reference in New Issue
Block a user