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

[nrk] reduce the number of instalments requests

This commit is contained in:
Remita Amine 2020-12-05 15:35:29 +01:00
parent 4c93b2fd15
commit 6bf95b15ee

View file

@ -121,6 +121,7 @@ class NRKIE(NRKBaseIE):
def _extract_from_playback(self, video_id): def _extract_from_playback(self, video_id):
path_templ = 'playback/%s/' + video_id path_templ = 'playback/%s/' + video_id
def call_playback_api(item, query=None): def call_playback_api(item, query=None):
return self._call_api(path_templ % item, video_id, item, query=query) return self._call_api(path_templ % item, video_id, item, query=query)
# known values for preferredCdn: akamai, iponly, minicdn and telenor # known values for preferredCdn: akamai, iponly, minicdn and telenor
@ -696,7 +697,8 @@ class NRKTVSeriesIE(NRKTVSerieBaseIE):
domain = 'radio' if site == 'radio.nrk' else 'tv' domain = 'radio' if site == 'radio.nrk' else 'tv'
series = self._call_api( series = self._call_api(
'%s/catalog/series/%s' % (domain, series_id), series_id, 'serie') '%s/catalog/series/%s' % (domain, series_id),
series_id, 'serie', query={'embeddedInstalmentsPageSize': 50})
titles = try_get(series, [ titles = try_get(series, [
lambda x: x['titles'], lambda x: x['titles'],
lambda x: x[x['type']]['titles'], lambda x: x[x['type']]['titles'],