mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-27 21:59:17 +01:00
[ie/mediasite] Fix extraction (#10273)
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Download Tests / Quick Download Tests (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, 3.10) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, 3.11) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, 3.12) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, pypy-3.10) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, pypy-3.8) (push) Waiting to run
Download Tests / Full Download Tests (windows-latest, 3.8) (push) Waiting to run
Download Tests / Full Download Tests (windows-latest, pypy-3.9) (push) Waiting to run
Quick Test / Core Test (push) Waiting to run
Quick Test / Code check (push) Waiting to run
Release (master) / release (push) Waiting to run
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Download Tests / Quick Download Tests (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, 3.10) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, 3.11) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, 3.12) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, pypy-3.10) (push) Waiting to run
Download Tests / Full Download Tests (ubuntu-latest, pypy-3.8) (push) Waiting to run
Download Tests / Full Download Tests (windows-latest, 3.8) (push) Waiting to run
Download Tests / Full Download Tests (windows-latest, pypy-3.9) (push) Waiting to run
Quick Test / Core Test (push) Waiting to run
Quick Test / Code check (push) Waiting to run
Release (master) / release (push) Waiting to run
Fix regression in add96eb9f8
Closes #10270
Authored by: bashonly
This commit is contained in:
parent
b758877afa
commit
0953209a85
1 changed files with 13 additions and 6 deletions
|
@ -15,6 +15,7 @@ from ..utils import (
|
||||||
url_or_none,
|
url_or_none,
|
||||||
urljoin,
|
urljoin,
|
||||||
)
|
)
|
||||||
|
from ..utils.traversal import traverse_obj
|
||||||
|
|
||||||
_ID_RE = r'(?:[0-9a-f]{32,34}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12,14})'
|
_ID_RE = r'(?:[0-9a-f]{32,34}|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12,14})'
|
||||||
|
|
||||||
|
@ -212,13 +213,14 @@ class MediasiteIE(InfoExtractor):
|
||||||
stream_type, 'type%u' % stream_type)
|
stream_type, 'type%u' % stream_type)
|
||||||
|
|
||||||
stream_formats = []
|
stream_formats = []
|
||||||
for unum, video_url in enumerate(video_urls):
|
for unum, video in enumerate(video_urls):
|
||||||
video_url = url_or_none(video_url.get('Location'))
|
video_url = url_or_none(video.get('Location'))
|
||||||
if not video_url:
|
if not video_url:
|
||||||
continue
|
continue
|
||||||
# XXX: if Stream.get('CanChangeScheme', False), switch scheme to HTTP/HTTPS
|
# XXX: if Stream.get('CanChangeScheme', False), switch scheme to HTTP/HTTPS
|
||||||
|
|
||||||
media_type = video_url.get('MediaType')
|
media_type = video.get('MediaType')
|
||||||
|
ext = mimetype2ext(video.get('MimeType'))
|
||||||
if media_type == 'SS':
|
if media_type == 'SS':
|
||||||
stream_formats.extend(self._extract_ism_formats(
|
stream_formats.extend(self._extract_ism_formats(
|
||||||
video_url, resource_id,
|
video_url, resource_id,
|
||||||
|
@ -229,15 +231,20 @@ class MediasiteIE(InfoExtractor):
|
||||||
video_url, resource_id,
|
video_url, resource_id,
|
||||||
mpd_id=f'{stream_id}-{snum}.{unum}',
|
mpd_id=f'{stream_id}-{snum}.{unum}',
|
||||||
fatal=False))
|
fatal=False))
|
||||||
|
elif ext in ('m3u', 'm3u8'):
|
||||||
|
stream_formats.extend(self._extract_m3u8_formats(
|
||||||
|
video_url, resource_id,
|
||||||
|
m3u8_id=f'{stream_id}-{snum}.{unum}',
|
||||||
|
fatal=False))
|
||||||
else:
|
else:
|
||||||
stream_formats.append({
|
stream_formats.append({
|
||||||
'format_id': f'{stream_id}-{snum}.{unum}',
|
'format_id': f'{stream_id}-{snum}.{unum}',
|
||||||
'url': video_url,
|
'url': video_url,
|
||||||
'ext': mimetype2ext(video_url.get('MimeType')),
|
'ext': ext,
|
||||||
})
|
})
|
||||||
|
|
||||||
if stream.get('HasSlideContent', False):
|
images = traverse_obj(player_options, ('PlayerLayoutOptions', 'Images', {dict}))
|
||||||
images = player_options['PlayerLayoutOptions']['Images']
|
if stream.get('HasSlideContent') and images:
|
||||||
stream_formats.append(self.__extract_slides(
|
stream_formats.append(self.__extract_slides(
|
||||||
stream_id=stream_id,
|
stream_id=stream_id,
|
||||||
snum=snum,
|
snum=snum,
|
||||||
|
|
Loading…
Reference in a new issue