Compare commits

..

1 Commits

Author SHA1 Message Date
Maciej Krüger
cd0e40c3e9
Merge 3525025a6f into c5098961b0 2024-11-18 02:28:17 +00:00

View File

@ -1,8 +1,9 @@
# coding: utf-8 # coding: utf-8
from __future__ import unicode_literals from __future__ import unicode_literals
import base64
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import compat_base64_b64decode
from ..utils import ( from ..utils import (
int_or_none, int_or_none,
js_to_json, js_to_json,
@ -18,7 +19,7 @@ class VOEIE(InfoExtractor):
'url': 'https://voe.sx/e/ng7ja5n5n2y8', 'url': 'https://voe.sx/e/ng7ja5n5n2y8',
'info_dict': { 'info_dict': {
'id': 'ng7ja5n5n2y8', 'id': 'ng7ja5n5n2y8',
'title': 'md5:8dd774de9b73851151d80ef6baaea7f1', 'title': 'md5:a86687fb962742f04652aee19ad34e06',
'thumbnail': r're:^https?://.*\.jpg$', 'thumbnail': r're:^https?://.*\.jpg$',
'ext': 'm3u8', 'ext': 'm3u8',
}, },
@ -31,12 +32,13 @@ class VOEIE(InfoExtractor):
'https://voe.sx/e/%s' % video_id, video_id) 'https://voe.sx/e/%s' % video_id, video_id)
player_url = self._search_regex( player_url = self._search_regex(
r'''("|')(?P<url>https://(?!voe\.sx/)[^/]+%s)\1\s*;''' % (video_path,), r'''("|')(?P<url>https://(?!voe\.sx/)[^/]+%s)\1\s*;''' % (path,),
webpage, 'redirect', group='url', default=None) webpage, 'redirect', group='url', default=None)
if player_url: if player_url:
webpage = self._download_webpage( webpage = self._download_webpage(
player_url, video_id, note='Redirecting to player page') player_url, video_id, note='Redirecting to player page')
sources = self._search_json( sources = self._search_json(
r'\bsources\s*=', webpage, 'sources', video_id, transform_source=js_to_json) r'\bsources\s*=', webpage, 'sources', video_id, transform_source=js_to_json)
@ -45,10 +47,10 @@ class VOEIE(InfoExtractor):
webpage, 'title', group='title') webpage, 'title', group='title')
formats = [] formats = []
for fmt in ('mp4', 'hls'): for fmt in ('mp4, 'hls'):
if fmt not in sources: if fmt not in sources:
continue continue
sources[fmt] = url_or_none(sources[fmt]) or url_or_none(compat_base64_b64decode(sources[fmt]).decode('utf-8')) sources[fmt] = url_or_none(sources['fmt']) or url_or_none(base64.b64decode(sources['fmt']))
f_url = sources.get('hls') f_url = sources.get('hls')
if f_url: if f_url:
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(