- url = video_data['url']
- # URL can be sometimes empty. Does this only happen when there is DRM?
- if url:
- formats = self._extract_m3u8_formats(
- self._proto_relative_url(url),
- video_id, 'mp4', 'm3u8_native')
- self._sort_formats(formats)
+ drm_formats = False
+
+ for resource in video_data['video_resources']:
+ if resource['type'] in ('dash', ):
+ formats += self._extract_mpd_formats(resource['manifest']['url'], video_id, mpd_id=resource['type'], fatal=False)
+ elif resource['type'] in ('hlsv3', 'hlsv6'):
+ formats += self._extract_m3u8_formats(resource['manifest']['url'], video_id, 'mp4', m3u8_id=resource['type'], fatal=False)
+ elif resource['type'] in self._UNPLAYABLE_FORMATS:
+ drm_formats = True
+
+ if not formats and drm_formats:
+ self.report_drm(video_id)
+ elif not formats and not video_data.get('policy_match'): # policy_match is False if content was removed
+ raise ExtractorError('This content is currently unavailable', expected=True)