Compare commits

...

4 Commits

Author SHA1 Message Date
JerryZhouSirui 86be860070
Merge 29af50950a into 1a366403d9 2024-04-28 19:37:08 +02:00
bashonly 1a366403d9
[build] Run `macos_legacy` job on `macos-12` (#9804)
`macos-latest` has been bumped to `macos-14-arm64` which breaks the builds

Authored by: bashonly
2024-04-28 15:35:17 +00:00
Simon Sawicki 7e26bd53f9
[core/windows] Fix tests for `sys.executable` with spaces (Fix for 64766459e3)
Authored by: Grub4K
2024-04-28 15:47:55 +02:00
JerryZhouSirui 29af50950a Fix Tele5 Extractor 2024-04-26 17:13:00 -04:00
3 changed files with 24 additions and 10 deletions

View File

@ -300,7 +300,7 @@ jobs:
macos_legacy:
needs: process
if: inputs.macos_legacy
runs-on: macos-latest
runs-on: macos-12
steps:
- uses: actions/checkout@v4

View File

@ -2090,10 +2090,7 @@ Line 1
args = [sys.executable, '-c', 'import sys; print(end=sys.argv[1])', argument, 'end']
assert run_shell(args) == expected
escaped = shell_quote(argument, shell=True)
args = f'{sys.executable} -c "import sys; print(end=sys.argv[1])" {escaped} end'
assert run_shell(args) == expected
assert run_shell(shell_quote(args, shell=True)) == expected
if __name__ == '__main__':

View File

@ -3,6 +3,8 @@ from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
extract_attributes,
try_get,
RegexNotFoundError
)
@ -74,16 +76,31 @@ class Tele5IE(DPlayIE): # XXX: Do not subclass from concrete IE
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
player_element = self._search_regex(r'(<hyoga-player\b[^>]+?>)', webpage, 'video player')
# Improved regex to handle different variations of <hyoga-player> tag
player_element_regex = r'(<hyoga-player\b[^>]*?>)'
player_element = self._search_regex(player_element_regex, webpage, 'video player', default=None)
if not player_element:
raise RegexNotFoundError('Could not find <hyoga-player> element. The page layout might have changed.')
player_info = extract_attributes(player_element)
asset_id, country, realm = (player_info[x] for x in ('assetid', 'locale', 'realm', ))
endpoint = compat_urlparse.urlparse(player_info['endpoint']).hostname
asset_id = player_info.get('assetid')
country = player_info.get('locale', 'DE')
realm = player_info.get('realm')
endpoint = try_get(player_info, lambda x: compat_urlparse.urlparse(x['endpoint']).hostname, str)
# Adjust source type handling if available
source_type = player_info.get('sourcetype')
if source_type:
endpoint = '%s-%s' % (source_type, endpoint)
endpoint = f'{source_type}-{endpoint}'
if not all([asset_id, endpoint, realm]):
raise ExtractorError('Necessary information missing from <hyoga-player> attributes')
try:
return self._get_disco_api_info(url, asset_id, endpoint, realm, country)
except ExtractorError as e:
if getattr(e, 'message', '') == 'Missing deviceId in context':
if 'Missing deviceId in context' in getattr(e, 'message', ''):
self.report_drm(video_id)
raise