mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-01-23 10:47:33 +01:00
[ie/afl] updated AFCVideoIE to extract video attrs using html extract_attributes function
This commit is contained in:
parent
549d28cd04
commit
74e26f7599
@ -4,6 +4,7 @@ from .omnyfm import OmnyFMShowIE
|
|||||||
from ..utils import (
|
from ..utils import (
|
||||||
extract_attributes,
|
extract_attributes,
|
||||||
get_element_by_class,
|
get_element_by_class,
|
||||||
|
get_element_html_by_id,
|
||||||
smuggle_url,
|
smuggle_url,
|
||||||
str_or_none,
|
str_or_none,
|
||||||
traverse_obj,
|
traverse_obj,
|
||||||
@ -153,8 +154,9 @@ class AFCVideoIE(InfoExtractor):
|
|||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, display_id)
|
webpage = self._download_webpage(url, display_id)
|
||||||
video_id = self._search_regex(r'"mediaId"\s*:\s*"(\d+)"', webpage, 'video-id')
|
video_id = self._search_regex(r'"mediaId"\s*:\s*"(\d+)"', webpage, 'video-id')
|
||||||
player_id = self._search_regex(r'data-player-id\s*=\s*"(\w+)"', webpage, 'player-id') + '_default'
|
video_attrs = extract_attributes(get_element_html_by_id('VideoModal', webpage))
|
||||||
account_id = self._search_regex(r'data-account-id\s*=\s*"(\d+)"', webpage, 'account-id')
|
player_id = video_attrs['data-player-id'] + '_default'
|
||||||
|
account_id = video_attrs['data-account-id']
|
||||||
|
|
||||||
video_url = f'https://players.brightcove.net/{account_id}/{player_id}/index.html?videoId={video_id}'
|
video_url = f'https://players.brightcove.net/{account_id}/{player_id}/index.html?videoId={video_id}'
|
||||||
video_url = smuggle_url(video_url, {'referrer': url})
|
video_url = smuggle_url(video_url, {'referrer': url})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user