2022-07-07 21:55:04 +00:00
|
|
|
from .common import InfoExtractor
|
2022-08-01 22:10:47 +00:00
|
|
|
from ..utils import make_archive_id
|
2022-07-07 21:55:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
class HTML5MediaEmbedIE(InfoExtractor):
|
|
|
|
_VALID_URL = False
|
|
|
|
IE_NAME = 'html5'
|
|
|
|
_WEBPAGE_TESTS = [
|
|
|
|
{
|
|
|
|
'url': 'https://html.com/media/',
|
|
|
|
'info_dict': {
|
|
|
|
'title': 'HTML5 Media',
|
|
|
|
'description': 'md5:933b2d02ceffe7a7a0f3c8326d91cc2a',
|
|
|
|
},
|
|
|
|
'playlist_count': 2
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
def _extract_from_webpage(self, url, webpage):
|
|
|
|
video_id, title = self._generic_id(url), self._generic_title(url)
|
|
|
|
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls') or []
|
|
|
|
for num, entry in enumerate(entries, start=1):
|
|
|
|
entry.update({
|
|
|
|
'id': f'{video_id}-{num}',
|
|
|
|
'title': f'{title} ({num})',
|
2022-07-13 09:33:05 +00:00
|
|
|
'_old_archive_ids': [
|
2022-08-01 22:10:47 +00:00
|
|
|
make_archive_id('generic', f'{video_id}-{num}' if len(entries) > 1 else video_id),
|
2022-07-13 09:33:05 +00:00
|
|
|
],
|
2022-07-07 21:55:04 +00:00
|
|
|
})
|
|
|
|
self._sort_formats(entry['formats'])
|
|
|
|
yield entry
|