Skip to content

Commit

Permalink
[voe] Add new extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Jul 22, 2021
1 parent a803582 commit 5fa74c1
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@
VoxMediaVolumeIE,
VoxMediaIE,
)
from .voe import VOEIE
from .vrt import VRTIE
from .vrak import VrakIE
from .vrv import (
Expand Down
46 changes: 46 additions & 0 deletions youtube_dl/extractor/voe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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',
'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,
}

0 comments on commit 5fa74c1

Please sign in to comment.