Compare commits

...

4 Commits

Author SHA1 Message Date
Iuri Campos
af61db38f3
Update yt_dlp/extractor/pandavideo.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2025-06-01 20:41:32 +01:00
Iuri Campos
2156f3da0e
Update yt_dlp/extractor/pandavideo.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2025-06-01 20:41:06 +01:00
Iuri Campos
31c6081b7c removed extra line 'formats' 2025-06-01 18:22:45 +01:00
Iuri Campos
24a6366f5e
Update yt_dlp/extractor/pandavideo.py
Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com>
2025-06-01 18:13:19 +01:00

View File

@ -2,8 +2,8 @@ from .common import InfoExtractor
class PandaVideoIE(InfoExtractor):
_VALID_URL = r'https?://(?P<server>[\w-]+)\.tv\.pandavideo\.com\.br/embed/?\?(?:[^#]*&)?v=(?P<id>[\da-f-]+)'
_EMBED_REGEX = [rf'<iframe[^>]+\bsrc=[\'"](?P<url>{_VALID_URL})']
_VALID_URL = r'https?://(?P<server>[\w-]+)\.tv\.pandavideo\.com\.br/embed/?\?(?:[^#"\']*&)?v=(?P<id>[\da-f-]+)'
_EMBED_REGEX = [rf'<iframe[^>]+\bsrc=["\'](?P<url>{_VALID_URL})']
_WEBPAGE_TESTS = [{
# Embedebd video test
'url': 'https://www.pandavideo.com/',
@ -64,13 +64,13 @@ class PandaVideoIE(InfoExtractor):
}]
def _real_extract(self, url: str) -> dict:
server, video_id = self._match_valid_url(url).groups()
manifest_url = f'https://{server}.tv.pandavideo.com.br/{video_id}/playlist.m3u8'
server, video_id = self._match_valid_url(url).group('server', 'id')
webpage = self._download_webpage(url, video_id)
return {
'id': video_id,
'url': url,
'formats': self._extract_m3u8_formats(
f'https://{server}.tv.pandavideo.com.br/{video_id}/playlist.m3u8', video_id, 'mp4', m3u8_id='hls'),
'title': self._html_search_regex(r'<title>([^<]+)</title>', webpage, 'title', default=f'pandavideo_{video_id}', fatal=False),
'description': self._html_search_meta('description', webpage, 'description', default=None, fatal=False),
'formats': self._extract_m3u8_formats(manifest_url, video_id),
}