From 8f0e4816e3d5912bab5beb21398598edf0812dc5 Mon Sep 17 00:00:00 2001 From: dirkf Date: Mon, 14 Nov 2022 16:24:27 +0000 Subject: [PATCH] Possibly working version pt.2 --- youtube_dl/extractor/extractors.py | 2 +- youtube_dl/extractor/generic.py | 8 ++++---- youtube_dl/extractor/panopto.py | 16 +++++++--------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index f42ff1720..c623e9be8 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -911,7 +911,7 @@ from .pandoratv import PandoraTVIE from .panopto import ( PanoptoIE, PanoptoListIE, - PanoptoPlaylistIE + PanoptoPlaylistIE, ) from .parliamentliveuk import ParliamentLiveUKIE from .patreon import PatreonIE diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index ad43c85e7..30c3745c5 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -130,7 +130,7 @@ from .kinja import KinjaEmbedIE from .arcpublishing import ArcPublishingIE from .medialaan import MedialaanIE from .simplecast import SimplecastIE -from .panopto import PanoptoBaseIE +from .panopto import PanoptoIE class GenericIE(InfoExtractor): @@ -3327,9 +3327,9 @@ class GenericIE(InfoExtractor): return self.playlist_from_matches( zype_urls, video_id, video_title, ie=ZypeIE.ie_key()) - panopto_urls = PanoptoBaseIE._extract_urls(webpage) - if panopto_urls: - return self.playlist_from_matches(panopto_urls, video_id, video_title) + panopto_entries = PanoptoIE._extract_from_webpage(url, webpage) + if panopto_entries: + return self.playlist_result(panopto_entries, video_id, video_title) # Look for HTML5 media entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls') if entries: diff --git a/youtube_dl/extractor/panopto.py b/youtube_dl/extractor/panopto.py index 8661e4419..ee708684f 100644 --- a/youtube_dl/extractor/panopto.py +++ b/youtube_dl/extractor/panopto.py @@ -280,7 +280,7 @@ class PanoptoIE(PanoptoBaseIE): @classmethod def suitable(cls, url): - return False if PanoptoPlaylistIE.suitable(url) else super().suitable(url) + return False if PanoptoPlaylistIE.suitable(url) else super(PanoptoIE, cls).suitable(url) @classmethod def _extract_from_webpage(cls, url, webpage): @@ -657,15 +657,13 @@ class PanoptoListIE(PanoptoBaseIE): if query: display_id += ': query "%s"' % (query, ) - info = { - '_type': 'playlist', - 'id': display_id, - 'title': display_id, - } + info = self.playlist_result( + OnDemandPagedList( + functools.partial(self._fetch_page, base_url, query_params, display_id), self._PAGE_SIZE), + playlist_id=display_id, + playlist_title=display_id) + if folder_id: info.update(self._extract_folder_metadata(base_url, folder_id)) - info['entries'] = OnDemandPagedList( - functools.partial(self._fetch_page, base_url, query_params, display_id), self._PAGE_SIZE) - return info