-
- video_url = self._search_regex(r'file: "(.*?)",',
- webpage, u'video URL')
-
- video_title = self._html_search_regex(r'<meta property="og:title" content="(?P<title>.*?)"',
- webpage, u'title').replace('LiveLeak.com -', '').strip()
-
- video_description = self._html_search_regex(r'<meta property="og:description" content="(?P<desc>.*?)"',
- webpage, u'description', fatal=False)
-
- video_uploader = self._html_search_regex(r'By:.*?(\w+)</a>',
- webpage, u'uploader', fatal=False)
-
- info = {
- 'id': video_id,
- 'url': video_url,
- 'ext': 'mp4',
+ 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)
+
+ video_title = self._og_search_title(webpage).replace('LiveLeak.com -', '').strip()
+ video_description = self._og_search_description(webpage)
+ video_uploader = self._html_search_regex(
+ r'By:.*?(\w+)</a>', webpage, 'uploader', fatal=False)
+
+ return {
+ 'id': video_id,