]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[mediaset] Add support for shortcut
authorSergey M․ <dstftw@gmail.com>
Sat, 13 May 2017 23:28:40 +0000 (06:28 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 13 May 2017 23:28:40 +0000 (06:28 +0700)
youtube_dl/extractor/mediaset.py

index 89e23ca9b3bb7d9cbbdf3ca365fd8ec268710089..3ebc7f2e11d153a440359bbbd35a8c3665902e20 100644 (file)
@@ -1,6 +1,8 @@
 # coding: utf-8
 from __future__ import unicode_literals
 
+import re
+
 from .common import InfoExtractor
 from ..compat import compat_str
 from ..utils import (
@@ -13,12 +15,15 @@ from ..utils import (
 
 class MediasetIE(InfoExtractor):
     _VALID_URL = r'''(?x)
-                    https?://
-                        (?:www\.)?video\.mediaset\.it/
-                        (?:
-                            (?:video|on-demand)/(?:[^/]+/)+[^/]+_|
-                            player/playerIFrame(?:Twitter)?\.shtml\?.*?\bid=
-                        )(?P<id>[0-9]+)
+                    (?:
+                        mediaset:|
+                        https?://
+                            (?:www\.)?video\.mediaset\.it/
+                            (?:
+                                (?:video|on-demand)/(?:[^/]+/)+[^/]+_|
+                                player/playerIFrame(?:Twitter)?\.shtml\?.*?\bid=
+                            )
+                    )(?P<id>[0-9]+)
                     '''
     _TESTS = [{
         # full episode
@@ -49,6 +54,9 @@ class MediasetIE(InfoExtractor):
         # iframe twitter (from http://www.wittytv.it/se-prima-mi-fidavo-zero/)
         'url': 'https://www.video.mediaset.it/player/playerIFrameTwitter.shtml?id=665104&playrelated=false&autoplay=false&related=true&hidesocial=true',
         'only_matching': True,
+    }, {
+        'url': 'mediaset:661824',
+        'only_matching': True,
     }]
 
     def _real_extract(self, url):