]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[nrk] Improve _VALID_URL
authorSergey M․ <dstftw@gmail.com>
Tue, 18 Oct 2016 20:02:14 +0000 (03:02 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 18 Oct 2016 20:02:14 +0000 (03:02 +0700)
youtube_dl/extractor/nrk.py

index c304282080d7677dc94fe6ff0692266458d7229e..3700b7ab2eec4070fee53258bb0707d79aa37728 100644 (file)
@@ -113,7 +113,17 @@ class NRKBaseIE(InfoExtractor):
 
 
 class NRKIE(NRKBaseIE):
-    _VALID_URL = r'(?:nrk:|https?://(?:www\.)?nrk\.no/video/PS\*)(?P<id>[^/?#&]+)'
+    _VALID_URL = r'''(?x)
+                        (?:
+                            nrk:|
+                            https?://
+                                (?:
+                                    (?:www\.)?nrk\.no/video/PS\*|
+                                    v8-psapi\.nrk\.no/mediaelement/
+                                )
+                            )
+                            (?P<id>[^/?#&]+)
+                        '''
     _API_HOST = 'v8.psapi.nrk.no'
     _TESTS = [{
         # video
@@ -140,6 +150,9 @@ class NRKIE(NRKBaseIE):
     }, {
         'url': 'nrk:ecc1b952-96dc-4a98-81b9-5296dc7a98d9',
         'only_matching': True,
+    }, {
+        'url': 'https://v8-psapi.nrk.no/mediaelement/ecc1b952-96dc-4a98-81b9-5296dc7a98d9',
+        'only_matching': True,
     }]