[nickru] Add extractor
authorSergey M․ <dstftw@gmail.com>
Sun, 23 Jul 2017 14:00:56 +0000 (21:00 +0700)
committerSergey M․ <dstftw@gmail.com>
Sun, 23 Jul 2017 14:02:06 +0000 (21:02 +0700)
youtube_dl/extractor/extractors.py
youtube_dl/extractor/nick.py

index db7616caa164abff5a31bf845b8f8acb17664938..2513f2587b97c6505f281c6eb785dc0b23ef493f 100644 (file)
@@ -673,6 +673,7 @@ from .nick import (
     NickIE,
     NickDeIE,
     NickNightIE,
+    NickRuIE,
 )
 from .niconico import NiconicoIE, NiconicoPlaylistIE
 from .ninecninemedia import (
index 1fa19cde4cffdb22050f11196cb60f539f1661a4..b688637bce957b98922857bff97e50e245618beb 100644 (file)
@@ -125,3 +125,21 @@ class NickNightIE(NickDeIE):
         return self._search_regex(
             r'mrss\s*:\s*(["\'])(?P<url>http.+?)\1', webpage,
             'mrss url', group='url')
+
+
+class NickRuIE(MTVServicesInfoExtractor):
+    IE_NAME = 'nickelodeonru'
+    _VALID_URL = r'https?://(?:www\.)nickelodeon\.ru/(?:playlist|shows|videos)/(?:[^/]+/)*(?P<id>[^/?#&]+)'
+    _TESTS = [{
+        'url': 'http://www.nickelodeon.ru/shows/henrydanger/videos/episodes/3-sezon-15-seriya-licenziya-na-polyot/pmomfb#playlist/7airc6',
+        'only_matching': True,
+    }, {
+        'url': 'http://www.nickelodeon.ru/videos/smotri-na-nickelodeon-v-iyule/g9hvh7',
+        'only_matching': True,
+    }]
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+        mgid = self._extract_mgid(webpage)
+        return self.url_result('http://media.mtvnservices.com/embed/%s' % mgid)