[videomega] Fix extraction (closes #7606)

This commit is contained in:
Yen Chi Hsuan 2016-02-26 15:00:48 +08:00
parent f52354a889
commit e4fc8d2ebe

View File

@ -4,11 +4,13 @@
import re import re
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import sanitized_Request from ..utils import (
decode_packed_codes,
sanitized_Request,
)
class VideoMegaIE(InfoExtractor): class VideoMegaIE(InfoExtractor):
_WORKING = False
_VALID_URL = r'(?:videomega:|https?://(?:www\.)?videomega\.tv/(?:(?:view|iframe|cdn)\.php)?\?ref=)(?P<id>[A-Za-z0-9]+)' _VALID_URL = r'(?:videomega:|https?://(?:www\.)?videomega\.tv/(?:(?:view|iframe|cdn)\.php)?\?ref=)(?P<id>[A-Za-z0-9]+)'
_TESTS = [{ _TESTS = [{
'url': 'http://videomega.tv/cdn.php?ref=AOSQBJYKIDDIKYJBQSOA', 'url': 'http://videomega.tv/cdn.php?ref=AOSQBJYKIDDIKYJBQSOA',
@ -42,8 +44,10 @@ def _real_extract(self, url):
r'(?:^[Vv]ideo[Mm]ega\.tv\s-\s*|\s*-\svideomega\.tv$)', '', title) r'(?:^[Vv]ideo[Mm]ega\.tv\s-\s*|\s*-\svideomega\.tv$)', '', title)
thumbnail = self._search_regex( thumbnail = self._search_regex(
r'<video[^>]+?poster="([^"]+)"', webpage, 'thumbnail', fatal=False) r'<video[^>]+?poster="([^"]+)"', webpage, 'thumbnail', fatal=False)
real_codes = decode_packed_codes(webpage)
video_url = self._search_regex( video_url = self._search_regex(
r'<source[^>]+?src="([^"]+)"', webpage, 'video URL') r'"src"\s*,\s*"([^"]+)"', real_codes, 'video URL')
return { return {
'id': video_id, 'id': video_id,