1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-05-18 11:09:32 +00:00

[voe] Add new extractor

This commit is contained in:
Maciej Krüger 2021-07-22 12:46:23 +02:00
parent a803582717
commit 8d2881a442
No known key found for this signature in database
GPG key ID: 0D948CE19CF49C5F
2 changed files with 48 additions and 0 deletions

View file

@ -1484,6 +1484,7 @@ from .voxmedia import (
VoxMediaVolumeIE,
VoxMediaIE,
)
from .voe import VOEIE
from .vrt import VRTIE
from .vrak import VrakIE
from .vrv import (

View file

@ -0,0 +1,47 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VOEIE(InfoExtractor):
IE_NAME = 'voe'
IE_DESC = 'VOE.SX'
_VALID_URL = r'https?://voe\.sx/(e/)?(?P<id>[a-z0-9]+)'
_TEST = {
'url': 'https://voe.sx/e/ng7ja5n5n2y8',
'info_dict': {
'id': 'ng7ja5n5n2y8',
'title': 'md5:05ab15eb43a32f0f5918755156c5fb34',
'thumbnail': r're:^https?://.*\.jpg$',
'ext': 'm3u8',
},
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
'https://voe.sx/e/%s' % video_id, video_id)
m3u8 = self._search_regex(
r'(https.+m3u8)',
webpage, 'm3u8')
title = self._search_regex(
r'<title>Watch (?P<title>.+)<\/title>',
webpage, 'title', group='title')
thumbnail = self._search_regex(
r'VOEPlayer.poster="(?P<thumbnail>https.+)"',
webpage, 'thumbnail', group='thumbnail')
formats = self._extract_m3u8_formats(m3u8, video_id)
self._sort_formats(formats)
return {
'id': video_id,
'title': title,
'formats': formats,
'thumbnail': thumbnail,
}