[ku6] Modernize
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 27 Oct 2014 01:32:44 +0000 (02:32 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 27 Oct 2014 01:32:44 +0000 (02:32 +0100)
youtube_dl/extractor/ku6.py

index 484239b19e9b20436eaa40e15263d7dd72c11445..89013e5223ade02697f96691ab5219da3a6b8c0c 100644 (file)
@@ -1,7 +1,5 @@
 from __future__ import unicode_literals
 
-import re
-
 from .common import InfoExtractor
 
 
@@ -18,11 +16,11 @@ class Ku6IE(InfoExtractor):
     }
 
     def _real_extract(self, url):
-        mobj = re.match(self._VALID_URL, url)
-        video_id = mobj.group('id')
-
+        video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
-        title = self._search_regex(r'<h1 title=.*>(.*?)</h1>', webpage, 'title')
+
+        title = self._html_search_regex(
+            r'<h1 title=.*>(.*?)</h1>', webpage, 'title')
         dataUrl = 'http://v.ku6.com/fetchVideo4Player/%s.html' % video_id
         jsonData = self._download_json(dataUrl, video_id)
         downloadUrl = jsonData['data']['f']