Release 2024.12.23
[yt-dlp.git] / yt_dlp / extractor / adobeconnect.py
blobb2934d6f76fd894c30161d7582d389ae0306b718
1 import urllib.parse
3 from .common import InfoExtractor
6 class AdobeConnectIE(InfoExtractor):
7 _VALID_URL = r'https?://\w+\.adobeconnect\.com/(?P<id>[\w-]+)'
9 def _real_extract(self, url):
10 video_id = self._match_id(url)
11 webpage = self._download_webpage(url, video_id)
12 title = self._html_extract_title(webpage)
13 qs = urllib.parse.parse_qs(self._search_regex(r"swfUrl\s*=\s*'([^']+)'", webpage, 'swf url').split('?')[1])
14 is_live = qs.get('isLive', ['false'])[0] == 'true'
15 formats = []
16 for con_string in qs['conStrings'][0].split(','):
17 formats.append({
18 'format_id': con_string.split('://')[0],
19 'app': urllib.parse.quote('?' + con_string.split('?')[1] + 'flvplayerapp/' + qs['appInstance'][0]),
20 'ext': 'flv',
21 'play_path': 'mp4:' + qs['streamName'][0],
22 'rtmp_conn': 'S:' + qs['ticket'][0],
23 'rtmp_live': is_live,
24 'url': con_string,
27 return {
28 'id': video_id,
29 'title': title,
30 'formats': formats,
31 'is_live': is_live,