- title = re.search(",kw:\"(.+)\"",webpage)
- if title is None:
- title = re.search(",kw: \'(.+)\'",webpage)
- title = title.group(1)
- thumbnail_url = re.search(",pic: \'(.+?)\'",webpage)
- if thumbnail_url is None:
- thumbnail_url = re.search(",pic:\"(.+?)\"",webpage)
- thumbnail_url = thumbnail_url.group(1)
-
- segs_json = self._search_regex(r'segs: \'(.*)\'', webpage, 'segments')
- segments = json.loads(segs_json)
+
+ youku_vcode = self._search_regex(
+ r'vcode\s*:\s*[\'"]([^\'"]*)[\'"]', webpage, 'youku vcode', default=None)
+ if youku_vcode:
+ return self.url_result('youku:' + youku_vcode, ie='Youku')
+
+ title = self._search_regex(
+ r',kw\s*:\s*[\'"]([^\'"]+)[\'"]', webpage, 'title')
+ thumbnail_url = self._search_regex(
+ r',pic\s*:\s*[\'"]([^\'"]+)[\'"]', webpage, 'thumbnail URL', fatal=False)
+
+ player_url = self._search_regex(
+ r'playerUrl\s*:\s*[\'"]([^\'"]+\.swf)[\'"]',
+ webpage, 'player URL', default=self._PLAYER_URL)
+
+ segments = self._parse_json(self._search_regex(
+ r'segs: \'([^\']+)\'', webpage, 'segments'), video_id)