[Vidlox] Add new extractor

This commit is contained in:
oksilapokyw 2017-03-25 01:45:52 +01:00
parent d0ba55871e
commit 173d26caef
2 changed files with 38 additions and 0 deletions

View File

@ -1126,6 +1126,7 @@ from .vidme import (
VidmeUserIE, VidmeUserIE,
VidmeUserLikesIE, VidmeUserLikesIE,
) )
from .vidlox import VidloxIE
from .vidzi import VidziIE from .vidzi import VidziIE
from .vier import VierIE, VierVideosIE from .vier import VierIE, VierVideosIE
from .viewlift import ( from .viewlift import (

View File

@ -0,0 +1,37 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VidloxIE(InfoExtractor):
_VALID_URL = r'https?://vidlox\.tv(/embed-|/)(?P<id>[0-9a-z]+)(\.html)?'
_TESTS = [{
'url': 'https://vidlox.tv/nc11cfucpp3m',
'md5': 'e3a7e1b5edee55570e35fd7641ffb174',
'info_dict': {
'id': 'nc11cfucpp3m',
'ext': 'mp4',
'title': 'Tetris cyka',
}
}, {
'url': 'https://vidlox.tv/embed-nc11cfucpp3m.html',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
url = 'https://vidlox.tv/' + video_id
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(
r'<h1([^>]*?)>(?P<title>.+)',
webpage, 'title', group=2)
m3u = self._html_search_regex(
r'sources:([\s]+?)\["(?P<url>.+?)",',
webpage, 'm3u', group=2)
formats = self._extract_m3u8_formats(m3u, video_id, ext='mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
return {
'id': video_id,
'title': title,
'formats': formats
}