- config_doc = self._download_xml(
- 'http://legacyweb-us.crackle.com/flash/QueryReferrer.ashx?site=16',
- video_id, 'Downloading config')
+ media = self._download_json(
+ 'https://web-api-us.crackle.com/Service.svc/details/media/%s/%s'
+ % (video_id, self._GEO_COUNTRIES[0]), video_id, query={
+ 'disableProtocols': 'true',
+ 'format': 'json'
+ })
+
+ title = media['Title']
+
+ formats = []
+ for e in media['MediaURLs']:
+ if e.get('UseDRM') is True:
+ continue
+ format_url = e.get('Path')
+ if not format_url or not isinstance(format_url, compat_str):
+ continue
+ ext = determine_ext(format_url)
+ if ext == 'm3u8':
+ formats.extend(self._extract_m3u8_formats(
+ format_url, video_id, 'mp4', entry_protocol='m3u8_native',
+ m3u8_id='hls', fatal=False))
+ elif ext == 'mpd':
+ formats.extend(self._extract_mpd_formats(
+ format_url, video_id, mpd_id='dash', fatal=False))
+ self._sort_formats(formats)