aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/nrk.py
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2020-12-05 16:24:49 +0100
committerRemita Amine <remitamine@gmail.com>2020-12-05 16:24:49 +0100
commit082da364166b5e33e1aa3ff643a177c0456b43e6 (patch)
tree752de73898834fa7e80a87b5368e10a791c91fc4 /youtube_dl/extractor/nrk.py
parent6bf95b15ee311d673e63ed5bc98d0b74040f24f0 (diff)
[nrk] reduce requests for Radio series
Diffstat (limited to 'youtube_dl/extractor/nrk.py')
-rw-r--r--youtube_dl/extractor/nrk.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py
index 24993b1c8..fdf2d7407 100644
--- a/youtube_dl/extractor/nrk.py
+++ b/youtube_dl/extractor/nrk.py
@@ -694,11 +694,13 @@ class NRKTVSeriesIE(NRKTVSerieBaseIE):
def _real_extract(self, url):
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(
'%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, [
lambda x: x['titles'],
lambda x: x[x['type']]['titles'],