mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-08 19:08:40 +00:00
[nrk] reduce requests for Radio series
This commit is contained in:
parent
6bf95b15ee
commit
082da36416
|
@ -694,11 +694,13 @@ class NRKTVSeriesIE(NRKTVSerieBaseIE):
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
site, series_id = re.match(self._VALID_URL, url).groups()
|
site, series_id = re.match(self._VALID_URL, url).groups()
|
||||||
domain = 'radio' if site == 'radio.nrk' else 'tv'
|
is_radio = site == 'radio.nrk'
|
||||||
|
domain = 'radio' if is_radio else 'tv'
|
||||||
|
|
||||||
|
size_prefix = 'p' if is_radio else 'embeddedInstalmentsP'
|
||||||
series = self._call_api(
|
series = self._call_api(
|
||||||
'%s/catalog/series/%s' % (domain, series_id),
|
'%s/catalog/series/%s' % (domain, series_id),
|
||||||
series_id, 'serie', query={'embeddedInstalmentsPageSize': 50})
|
series_id, 'serie', query={size_prefix + 'ageSize': 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'],
|
||||||
|
|
Loading…
Reference in a new issue