[GenericIE] Add support for embedded blip.tv
authorrzhxeo <rzhxeot7z81b4700@mailcatch.com>
Mon, 16 Dec 2013 19:08:23 +0000 (20:08 +0100)
committerrzhxeo <rzhxeot7z81b4700@mailcatch.com>
Mon, 16 Dec 2013 19:08:23 +0000 (20:08 +0100)
youtube_dl/extractor/generic.py

index 216e032186297b7b91a488fb1edd1421e3270b39..a7ea9f733ce8c57076f8acaf496ad0109470ad2d 100644 (file)
@@ -222,6 +222,18 @@ class GenericIE(InfoExtractor):
                 'id': video_id,
             }
 
+        # Look for embedded blip.tv player
+        mobj = re.search(r'<meta\s[^>]*https?://api.blip.tv/\w+/redirect/\w+/(\d+)', webpage)
+        if mobj:
+            return self.url_result('http://blip.tv/seo/-'+mobj.group(1), 'BlipTV')
+        mobj = re.search(r'<(?:iframe|embed|object)\s[^>]*https?://(?:\w+\.)?blip.tv/(?:play/|api\.swf#)([a-zA-Z0-9]+)', webpage)
+        if mobj:
+            player_url = 'http://blip.tv/play/%s.x?p=1' % mobj.group(1)
+            player_page = self._download_webpage(player_url, mobj.group(1))
+            blip_video_id = self._search_regex(r'data-episode-id="(\d+)', player_page, u'blip_video_id', fatal=False)
+            if blip_video_id:
+                return self.url_result('http://blip.tv/seo/-'+blip_video_id, 'BlipTV')
+
         # Look for Bandcamp pages with custom domain
         mobj = re.search(r'<meta property="og:url"[^>]*?content="(.*?bandcamp\.com.*?)"', webpage)
         if mobj is not None: