[videomega] Fix extraction (Closes #4763)

This commit is contained in:
Naglis Jonaitis 2015-01-22 18:35:53 +02:00
parent 898c23c03f
commit bb6e38787d
1 changed files with 8 additions and 2 deletions

View File

@ -1,12 +1,15 @@
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import re
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import ( from ..compat import (
compat_urllib_parse, compat_urllib_parse,
compat_urllib_request, compat_urllib_request,
) )
from ..utils import ( from ..utils import (
ExtractorError,
remove_start, remove_start,
) )
@ -35,8 +38,11 @@ class VideoMegaIE(InfoExtractor):
req.add_header('Referer', url) req.add_header('Referer', url)
webpage = self._download_webpage(req, video_id) webpage = self._download_webpage(req, video_id)
escaped_data = self._search_regex( try:
r'unescape\("([^"]+)"\)', webpage, 'escaped data') escaped_data = re.findall(r'unescape\("([^"]+)"\)', webpage)[-1]
except IndexError:
raise ExtractorError('Unable to extract escaped data')
playlist = compat_urllib_parse.unquote(escaped_data) playlist = compat_urllib_parse.unquote(escaped_data)
thumbnail = self._search_regex( thumbnail = self._search_regex(