1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-05-19 11:39:28 +00:00

Add Ongehoord Nederland and test URL for BNNVARA

This commit is contained in:
Bart Broere 2024-03-05 13:43:56 +01:00
parent 4fc423845e
commit 28ba01f1cc
2 changed files with 31 additions and 1 deletions

View file

@ -847,7 +847,7 @@ from .nowness import (
NownessSeriesIE,
)
from .noz import NozIE
from .npo import BNNVaraIE, NPOIE
from .npo import BNNVaraIE, NPOIE, ONIE
from .npr import NprIE
from .nrk import (
NRKIE,

View file

@ -1,6 +1,7 @@
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
@ -129,6 +130,9 @@ class BNNVaraIE(NPOIE):
IE_NAME = 'bnnvara'
IE_DESC = 'bnnvara.nl'
_VALID_URL = r'https?://(?:www\.)?bnnvara\.nl/videos/[0-9]*'
_TESTS = [{
'url': 'https://www.bnnvara.nl/videos/27455',
}]
def _real_extract(self, url):
url = url.rstrip('/')
@ -159,3 +163,29 @@ class BNNVaraIE(NPOIE):
'formats': formats,
'thumbnail': media.get('data', {}).get('player', {}).get('image').get('url'),
}
class ONIE(NPOIE):
IE_NAME = 'on'
IE_DESC = 'ongehoordnederland.tv'
_VALID_URL = r'https?://(?:www\.)?ongehoordnederland.tv/.*'
_TESTS = [{
'url': 'https://ongehoordnederland.tv/2024/03/01/korte-clips/heeft-preppen-zin-betwijfel-dat-je-daar-echt-iets-aan-zult-hebben-bij-oorlog-lydia-daniel/',
}]
def _real_extract(self, url):
video_id = url.rstrip('/').split('/')[-1]
page, _ = self._download_webpage_handle(url, video_id)
results = re.findall("page: '(.+)'", page)
formats = []
for result in results:
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.')
return {
'id': video_id,
'title': video_id,
'formats': formats,
}