mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-29 20:15:53 +00:00
Compare commits
2 Commits
d6aa8c235d
...
4e680db150
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e680db150 | ||
|
|
45a3b42bb9 |
@ -268,6 +268,7 @@ from .bitchute import (
|
|||||||
BitChuteChannelIE,
|
BitChuteChannelIE,
|
||||||
BitChuteIE,
|
BitChuteIE,
|
||||||
)
|
)
|
||||||
|
from .bitmovin import BitmovinIE
|
||||||
from .blackboardcollaborate import (
|
from .blackboardcollaborate import (
|
||||||
BlackboardCollaborateIE,
|
BlackboardCollaborateIE,
|
||||||
BlackboardCollaborateLaunchIE,
|
BlackboardCollaborateLaunchIE,
|
||||||
@ -1368,6 +1369,7 @@ from .nova import (
|
|||||||
NovaIE,
|
NovaIE,
|
||||||
)
|
)
|
||||||
from .novaplay import NovaPlayIE
|
from .novaplay import NovaPlayIE
|
||||||
|
from .nowcanal import NowCanalIE
|
||||||
from .nowness import (
|
from .nowness import (
|
||||||
NownessIE,
|
NownessIE,
|
||||||
NownessPlaylistIE,
|
NownessPlaylistIE,
|
||||||
|
|||||||
74
yt_dlp/extractor/bitmovin.py
Normal file
74
yt_dlp/extractor/bitmovin.py
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils.traversal import traverse_obj
|
||||||
|
|
||||||
|
|
||||||
|
class BitmovinIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://streams\.bitmovin\.com/(?P<id>\w+)'
|
||||||
|
_EMBED_REGEX = [r'<iframe\b[^>]+\bsrc=["\'](?P<url>(?:https?:)?//streams\.bitmovin\.com/(?P<id>\w+)[^"\']+)']
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://streams.bitmovin.com/cqkl1t5giv3lrce7pjbg/embed',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'cqkl1t5giv3lrce7pjbg',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Developing Osteopathic Residents as Faculty',
|
||||||
|
'thumbnail': 'https://streams.bitmovin.com/cqkl1t5giv3lrce7pjbg/poster',
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
|
}, {
|
||||||
|
'url': 'https://streams.bitmovin.com/cgl9rh94uvs51rqc8jhg/share',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'cgl9rh94uvs51rqc8jhg',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Big Buck Bunny (Streams Docs)',
|
||||||
|
'thumbnail': 'https://streams.bitmovin.com/cgl9rh94uvs51rqc8jhg/poster',
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
|
}]
|
||||||
|
_WEBPAGE_TESTS = [{
|
||||||
|
# bitmovin-stream web component
|
||||||
|
'url': 'https://www.institutionalinvestor.com/article/2bsw1in1l9k68mp9kritc/video-war-stories-over-board-games/best-case-i-get-fired-war-stories',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'cuiumeil6g115lc4li3g',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': '[media] War Stories over Board Games: “Best Case: I Get Fired” ',
|
||||||
|
'thumbnail': 'https://streams.bitmovin.com/cuiumeil6g115lc4li3g/poster',
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
|
}, {
|
||||||
|
# iframe embed
|
||||||
|
'url': 'https://www.clearblueionizer.com/en/pool-ionizers/mineral-pool-vs-saltwater-pool/',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'cvpvfsm1pf7itg7cfvtg',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Pool Ionizer vs. Salt Chlorinator',
|
||||||
|
'thumbnail': 'https://streams.bitmovin.com/cvpvfsm1pf7itg7cfvtg/poster',
|
||||||
|
},
|
||||||
|
'params': {'skip_download': 'm3u8'},
|
||||||
|
}]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def _extract_embed_urls(cls, url, webpage):
|
||||||
|
yield from super()._extract_embed_urls(url, webpage)
|
||||||
|
for stream_id in re.findall(r'<bitmovin-stream\b[^>]*\bstream-id=["\'](?P<id>\w+)', webpage):
|
||||||
|
yield f'https://streams.bitmovin.com/{stream_id}'
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._match_id(url)
|
||||||
|
|
||||||
|
player_config = self._download_json(
|
||||||
|
f'https://streams.bitmovin.com/{video_id}/config', video_id)['sources']
|
||||||
|
|
||||||
|
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
|
||||||
|
player_config['hls'], video_id, 'mp4')
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'formats': formats,
|
||||||
|
'subtitles': subtitles,
|
||||||
|
**traverse_obj(player_config, {
|
||||||
|
'title': ('title', {str}),
|
||||||
|
'thumbnail': ('poster', {str}),
|
||||||
|
}),
|
||||||
|
}
|
||||||
37
yt_dlp/extractor/nowcanal.py
Normal file
37
yt_dlp/extractor/nowcanal.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
from .brightcove import BrightcoveNewIE
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class NowCanalIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?nowcanal\.pt(?:/[\w-]+)+/detalhe/(?P<id>[\w-]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://www.nowcanal.pt/ultimas/detalhe/pedro-sousa-hjulmand-pode-ter-uma-saida-limpa-do-sporting-daqui-a-um-ano',
|
||||||
|
'md5': '047f17cb783e66e467d703e704bbc95d',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '6376598467112',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Pedro Sousa «Hjulmand pode ter uma saída limpa do Sporting daqui a um ano»',
|
||||||
|
'description': '',
|
||||||
|
'uploader_id': '6108484330001',
|
||||||
|
'duration': 65.237,
|
||||||
|
'thumbnail': r're:^https://.+\.jpg',
|
||||||
|
'timestamp': 1754440620,
|
||||||
|
'upload_date': '20250806',
|
||||||
|
'tags': ['now'],
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'https://www.nowcanal.pt/programas/frente-a-frente/detalhe/frente-a-frente-eva-cruzeiro-ps-e-rita-matias-chega',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
|
||||||
|
_BC_URL_TMPL = 'https://players.brightcove.net/6108484330001/chhIqzukMq_default/index.html?videoId={}'
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
display_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
video_id = self._search_json(
|
||||||
|
r'videoHandler\.addBrightcoveVideoWithJson\(\[',
|
||||||
|
webpage, 'video data', display_id)['brightcoveVideoId']
|
||||||
|
|
||||||
|
return self.url_result(self._BC_URL_TMPL.format(video_id), BrightcoveNewIE)
|
||||||
Loading…
x
Reference in New Issue
Block a user