- video_url = self._search_regex(
- r'file: "(.*?)",', webpage, 'video URL')
+ sources_raw = self._search_regex(
+ r'(?s)sources:\s*(\[.*?\]),', webpage, 'video URLs', default=None)
+ if sources_raw is None:
+ sources_raw = '[{ %s}]' % (
+ self._search_regex(r'(file: ".*?"),', webpage, 'video URL'))
+
+ sources_json = re.sub(r'\s([a-z]+):\s', r'"\1": ', sources_raw)
+ sources = json.loads(sources_json)
+
+ formats = [{
+ 'format_note': s.get('label'),
+ 'url': s['file'],
+ } for s in sources]
+ self._sort_formats(formats)