Merge remote-tracking branch 'jcarlosgarciasegovia/master'
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 3 Mar 2013 21:04:06 +0000 (22:04 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 3 Mar 2013 21:04:06 +0000 (22:04 +0100)
youtube_dl/InfoExtractors.py

index c696bb96831e057747c2bff9494d55456278d2c6..d19efe93fb84f604db002f53b3e0b7c40dcb5012 100755 (executable)
@@ -2165,6 +2165,21 @@ class BlipTVIE(InfoExtractor):
             self._downloader.trouble(u'ERROR: invalid URL: %s' % url)
             return
 
+        if '/play/' in url:
+            request = compat_urllib_request.Request(url)
+            response = compat_urllib_request.urlopen(request)
+            redirecturl = response.geturl()
+            hashindex = redirecturl.find('#')
+            if hashindex!=-1:
+                hash = redirecturl[hashindex+1:]
+                params = compat_parse_qs(hash)
+                files = params['file']
+                for file in files:
+                    match = re.search('/(\d+)',file)
+                    if match:
+                        file_id = match.group(1)
+                        url = 'http://blip.tv/a/a-'+file_id
+
         if '?' in url:
             cchar = '&'
         else: