[ie/wistia] Support password-protected videos (#11100)
[yt-dlp3.git] / yt_dlp / extractor / ebay.py
blobf1d122f8872fde5807d1788436c902b0197ac5d0
1 from .common import InfoExtractor
2 from ..utils import remove_end
5 class EbayIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:www\.)?ebay\.com/itm/(?P<id>\d+)'
7 _TESTS = [{
8 'url': 'https://www.ebay.com/itm/194509326719',
9 'info_dict': {
10 'id': '194509326719',
11 'ext': 'mp4',
12 'title': 'WiFi internal antenna adhesive for wifi 2.4GHz wifi 5 wifi 6 wifi 6E full bands',
14 'params': {'skip_download': 'm3u8'},
17 def _real_extract(self, url):
18 video_id = self._match_id(url)
19 webpage = self._download_webpage(url, video_id)
21 video_json = self._search_json(r'"video":', webpage, 'video json', video_id)
23 formats = []
24 for key, url in video_json['playlistMap'].items():
25 if key == 'HLS':
26 formats.extend(self._extract_m3u8_formats(url, video_id, fatal=False))
27 elif key == 'DASH':
28 formats.extend(self._extract_mpd_formats(url, video_id, fatal=False))
29 else:
30 self.report_warning(f'Unsupported format {key}', video_id)
32 return {
33 'id': video_id,
34 'title': remove_end(self._html_extract_title(webpage), ' | eBay'),
35 'formats': formats,