mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-16 22:37:35 +00:00
Add scaffolding for last few extractors and change order so the PR diff looks nice
This commit is contained in:
parent
681b39032a
commit
159f825edd
@ -11,16 +11,7 @@ from ..utils import ExtractorError
|
|||||||
class NPOIE(InfoExtractor):
|
class NPOIE(InfoExtractor):
|
||||||
IE_NAME = 'npo'
|
IE_NAME = 'npo'
|
||||||
IE_DESC = 'npo.nl'
|
IE_DESC = 'npo.nl'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'https?://(?:www\.)?npo\.nl/.*'
|
||||||
(?:
|
|
||||||
https?://
|
|
||||||
(?:www\.)?
|
|
||||||
(?:
|
|
||||||
npo\.nl/(?:[^/]+/)*
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(?P<id>[^/?#]+)
|
|
||||||
'''
|
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://npo.nl/start/serie/zembla/seizoen-2015/wie-is-de-mol-2/',
|
'url': 'https://npo.nl/start/serie/zembla/seizoen-2015/wie-is-de-mol-2/',
|
||||||
@ -176,35 +167,6 @@ class ONIE(NPOIE):
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class VPROIE(NPOIE):
|
|
||||||
IE_NAME = 'vpro'
|
|
||||||
IE_DESC = 'vpro.nl'
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?vpro.nl/.*'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://www.vpro.nl/programmas/tegenlicht/kijk/afleveringen/2015-2016/offline-als-luxe.html',
|
|
||||||
# TODO fill in other test attributes
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
video_id = url.rstrip('/').split('/')[-1]
|
|
||||||
page, _ = self._download_webpage_handle(url, video_id)
|
|
||||||
results = re.findall(r'data-media-id="(.+_.+)"\s', page)
|
|
||||||
formats = []
|
|
||||||
for result in results:
|
|
||||||
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:
|
|
||||||
raise ExtractorError('Could not find a POMS product id in the provided URL, '
|
|
||||||
'perhaps because all stream URLs are DRM protected.')
|
|
||||||
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'title': video_id,
|
|
||||||
'formats': formats,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class ZAPPIE(NPOIE):
|
class ZAPPIE(NPOIE):
|
||||||
IE_NAME = 'zapp'
|
IE_NAME = 'zapp'
|
||||||
IE_DESC = 'zapp.nl'
|
IE_DESC = 'zapp.nl'
|
||||||
@ -264,3 +226,54 @@ class SchoolTVIE(NPOIE):
|
|||||||
'description': metadata.get('description') or metadata.get('short_description'),
|
'description': metadata.get('description') or metadata.get('short_description'),
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class HetKlokhuisIE(NPOIE):
|
||||||
|
...
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
class VPROIE(NPOIE):
|
||||||
|
IE_NAME = 'vpro'
|
||||||
|
IE_DESC = 'vpro.nl'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?vpro.nl/.*'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://www.vpro.nl/programmas/tegenlicht/kijk/afleveringen/2015-2016/offline-als-luxe.html',
|
||||||
|
# TODO fill in other test attributes
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = url.rstrip('/').split('/')[-1]
|
||||||
|
page, _ = self._download_webpage_handle(url, video_id)
|
||||||
|
results = re.findall(r'data-media-id="(.+_.+)"\s', page)
|
||||||
|
formats = []
|
||||||
|
for result in results:
|
||||||
|
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:
|
||||||
|
raise ExtractorError('Could not find a POMS product id in the provided URL, '
|
||||||
|
'perhaps because all stream URLs are DRM protected.')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': video_id,
|
||||||
|
'formats': formats,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class WNLIE(NPOIE):
|
||||||
|
...
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
class AndereTijdenIE(NPOIE):
|
||||||
|
...
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
...
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user