Add support for Clapper library and add extractor Vidlox
This commit is contained in:
parent
9dc48d44b5
commit
99d88a0b5c
@ -3131,8 +3131,7 @@ class GenericIE(InfoExtractor):
|
|||||||
# Clappr.player()
|
# Clappr.player()
|
||||||
clappr_dict = self._find_clappr_data(webpage, video_id)
|
clappr_dict = self._find_clappr_data(webpage, video_id)
|
||||||
if clappr_dict:
|
if clappr_dict:
|
||||||
info = self._parse_clappr_data(clappr_dict,
|
info = self._parse_clappr_data(clappr_dict, video_id=video_id, base_url=url)
|
||||||
video_id=video_id, base_url=url)
|
|
||||||
return merge_dicts(info, info_dict)
|
return merge_dicts(info, info_dict)
|
||||||
|
|
||||||
# Video.js embed
|
# Video.js embed
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from ..utils import ExtractorError
|
from ..utils import ExtractorError
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from .openload import PhantomJSwrapper
|
from .openload import PhantomJSwrapper
|
||||||
@ -30,8 +28,6 @@ class VidloxIE(InfoExtractor):
|
|||||||
'only_matching': True,
|
'only_matching': True,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
|
||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
@ -46,30 +42,21 @@ class VidloxIE(InfoExtractor):
|
|||||||
title = None
|
title = None
|
||||||
if 'This video can be watched as embed only.' in webpage:
|
if 'This video can be watched as embed only.' in webpage:
|
||||||
# extract tilte and download embed
|
# extract tilte and download embed
|
||||||
title = self._html_search_regex(
|
title = self._html_search_regex(r'<title[^>]*?>(?P<title>.+?)\s*</title>', webpage, 'title').replace('Watch ', '', 1)
|
||||||
r'<title[^>]*?>(?P<title>.+?)\s*</title>', webpage, 'title').replace('Watch ','',1)
|
|
||||||
webpage = None
|
webpage = None
|
||||||
page_url = "https://vidlox.me/embed-%s.html" % video_id
|
page_url = "https://vidlox.me/embed-%s.html" % video_id
|
||||||
|
|
||||||
# execute JS
|
# execute JS
|
||||||
webpage, _ = phantom.get(page_url, webpage, video_id=video_id)
|
webpage, _ = phantom.get(page_url, webpage, video_id=video_id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# extract player data
|
# extract player data
|
||||||
clappr_dict = self._find_clappr_data(webpage, video_id)
|
clappr_dict = self._find_clappr_data(webpage, video_id)
|
||||||
if not clappr_dict:
|
if not clappr_dict:
|
||||||
raise ExtractorError('Player data not found',
|
raise ExtractorError('Clappr data not found', expected=False, video_id=video_id)
|
||||||
expected=False, video_id=video_id)
|
|
||||||
|
|
||||||
# and parse it
|
# and parse it
|
||||||
info_dict = self._parse_clappr_data(clappr_dict,
|
info_dict = self._parse_clappr_data(clappr_dict, video_id=video_id, base_url=page_url)
|
||||||
video_id=video_id, base_url=page_url)
|
|
||||||
|
|
||||||
info_dict['title'] = title or self._html_search_regex(
|
|
||||||
r'<h1[^>]*?>(?P<title>.+?)\s*</h1>', webpage, 'title')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
info_dict['title'] = title or self._html_search_regex(r'<h1[^>]*?>(?P<title>.+?)\s*</h1>', webpage, 'title')
|
||||||
|
|
||||||
return info_dict
|
return info_dict
|
||||||
|
Loading…
x
Reference in New Issue
Block a user