mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 19:33:59 +01:00
[ie/omnyfm] added back the InAdvancePagedList function
This commit is contained in:
parent
4ff1288758
commit
2c49f52c04
|
@ -1,8 +1,9 @@
|
||||||
import functools
|
import functools
|
||||||
|
import math
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
OnDemandPagedList,
|
InAdvancePagedList,
|
||||||
clean_html,
|
clean_html,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
@ -57,8 +58,11 @@ def _real_extract(self, url):
|
||||||
data = self._search_nextjs_data(webpage, display_id)
|
data = self._search_nextjs_data(webpage, display_id)
|
||||||
org_id = traverse_obj(data, ('props', 'pageProps', 'program', 'OrganizationId', {str_or_none}))
|
org_id = traverse_obj(data, ('props', 'pageProps', 'program', 'OrganizationId', {str_or_none}))
|
||||||
playlist_id = traverse_obj(data, ('props', 'pageProps', 'program', 'Id', {str_or_none}))
|
playlist_id = traverse_obj(data, ('props', 'pageProps', 'program', 'Id', {str_or_none}))
|
||||||
|
playlist_count = traverse_obj(data, ('props', 'pageProps', 'program', 'DefaultPlaylist', 'NumberOfClips', {int_or_none}))
|
||||||
title = traverse_obj(data, ('props', 'pageProps', 'program', 'Name', {str_or_none}))
|
title = traverse_obj(data, ('props', 'pageProps', 'program', 'Name', {str_or_none}))
|
||||||
first_page_data = traverse_obj(data, ('props', 'pageProps', 'clips', {dict}))
|
first_page_data = traverse_obj(data, ('props', 'pageProps', 'clips', {dict}))
|
||||||
|
total_pages = math.ceil(playlist_count / self._PAGE_SIZE)
|
||||||
|
|
||||||
entries = OnDemandPagedList(functools.partial(self._entries, org_id, playlist_id, first_page_data), self._PAGE_SIZE)
|
return self.playlist_result(InAdvancePagedList(
|
||||||
return self.playlist_result(entries, playlist_id, title)
|
functools.partial(self._entries, org_id, playlist_id, first_page_data),
|
||||||
|
total_pages, self._PAGE_SIZE), playlist_id, title)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user