diff options
author | Sergey M․ <dstftw@gmail.com> | 2021-01-03 06:44:28 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2021-01-03 06:44:28 +0700 |
commit | 7b643d4cd0f5aa02149e29d8212acd42038da63b (patch) | |
tree | 7702d9a410c0d1bee8f9495f416dd398d87cc7bf /youtube_dl/extractor/nrk.py | |
parent | 1f1d01d498fee8120bb3415b1b1a20e21259bbf4 (diff) | |
download | youtube-dl-7b643d4cd0f5aa02149e29d8212acd42038da63b.tar.xz |
[nrk] Improve video id extraction
Diffstat (limited to 'youtube_dl/extractor/nrk.py')
-rw-r--r-- | youtube_dl/extractor/nrk.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py index 61a7c9aad..5f12b0d9e 100644 --- a/youtube_dl/extractor/nrk.py +++ b/youtube_dl/extractor/nrk.py @@ -151,6 +151,8 @@ class NRKIE(NRKBaseIE): # known values for preferredCdn: akamai, iponly, minicdn and telenor manifest = call_playback_api('manifest', {'preferredCdn': 'akamai'}) + video_id = try_get(manifest, lambda x: x['id'], compat_str) or video_id + if manifest.get('playability') == 'nonPlayable': self._raise_error(manifest['nonPlayable']) @@ -211,7 +213,7 @@ class NRKIE(NRKBaseIE): } def _real_extract(self, url): - video_id = self._match_id(url) + video_id = self._match_id(url).split('/')[-1] return self._extract_from_playback(video_id) |