]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[vgtv] improve _VALID_URL regex
authorremitamine <remitamine@gmail.com>
Fri, 30 Oct 2015 09:20:38 +0000 (10:20 +0100)
committerremitamine <remitamine@gmail.com>
Fri, 30 Oct 2015 09:20:38 +0000 (10:20 +0100)
youtube_dl/extractor/vgtv.py

index 17213d9b69c0ed463658a892565a3d6647a8cb4b..e8039ec7fd1ac20841f79fe578419289f5a2ad94 100644 (file)
@@ -11,17 +11,19 @@ from ..utils import (
 
 
 class VGTVIE(InfoExtractor):
-    IE_DESC = 'VGTV, BTTV, FTV, Aftenposten, Aftonbladet'
+    IE_DESC = 'VGTV, BTTV, FTV, Aftenposten and Aftonbladet'
     _VALID_URL = r'''(?x)
-                    (?:
-                        vgtv:|
-                        http://(?:www\.)?
+                    http://(?:www\.)?
+                    (?P<host>
+                        vgtv.no|
+                        (?:bt|aftenbladet).no/tv|
+                        fvn.no/fvntv|
+                        aftenposten.no/webtv
                     )
-                    (?P<host>vgtv.no|(?:bt.no|aftenbladet.no)/tv|fvn.no/fvntv|aftenposten.no/webtv)
+                    /
                     (?:
-                        :|
-                        /\#!/(?:video|live)/|
-                        /embed?id=
+                        \#!/(?:video|live)/|
+                        embed?.*id=
                     )
                     (?P<id>[0-9]+)
                     '''
@@ -211,7 +213,7 @@ class BTArticleIE(InfoExtractor):
         webpage = self._download_webpage(url, self._match_id(url))
         video_id = self._search_regex(
             r'SVP\.Player\.load\(\s*(\d+)', webpage, 'video id')
-        return self.url_result('vgtv:bt:%s' % video_id, 'VGTV')
+        return self.url_result('http://bt.no/tv/embed?id=%s' % video_id, 'VGTV')
 
 
 class BTVestlendingenIE(InfoExtractor):