1 from __future__ import unicode_literals
5 from .common import InfoExtractor
12 class ABCIE(InfoExtractor):
13 IE_NAME = 'abc.net.au'
14 _VALID_URL = r'http://www\.abc\.net\.au/news/[^/]+/[^/]+/(?P<id>\d+)'
17 'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebola-treatment-centre-in-sierra-leone/5868334',
18 'md5': 'cb3dd03b18455a661071ee1e28344d9f',
22 'title': 'Australia to help staff Ebola treatment centre in Sierra Leone',
23 'description': 'md5:809ad29c67a05f54eb41f2a105693a67',
26 'url': 'http://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326',
27 'md5': 'db2a5369238b51f9811ad815b69dc086',
31 'upload_date': '20150816',
32 'uploader': 'ABC News (Australia)',
33 'description': 'Government backbencher Warren Entsch introduces a cross-party sponsored bill to legalise same-sex marriage, saying the bill is designed to promote "an inclusive Australia, not a divided one.". Read more here: http://ab.co/1Mwc6ef',
34 'uploader_id': 'NewsOnABC',
35 'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill',
37 'add_ie': ['Youtube'],
40 def _real_extract(self, url):
41 video_id = self._match_id(url)
42 webpage = self._download_webpage(url, video_id)
45 r'inline(?P<type>Video|YouTube)Data\.push\((?P<json_data>[^)]+)\);',
48 raise ExtractorError('Unable to extract video urls')
50 urls_info = self._parse_json(
51 mobj.group('json_data'), video_id, transform_source=js_to_json)
53 if not isinstance(urls_info, list):
54 urls_info = [urls_info]
56 if mobj.group('type') == 'YouTube':
57 return self.playlist_result([
58 self.url_result(url_info['url']) for url_info in urls_info])
61 'url': url_info['url'],
62 'width': int(url_info['width']),
63 'height': int(url_info['height']),
64 'tbr': int(url_info['bitrate']),
65 'filesize': int(url_info['filesize']),
66 } for url_info in urls_info]
67 self._sort_formats(formats)
71 'title': self._og_search_title(webpage),
73 'description': self._og_search_description(webpage),
74 'thumbnail': self._og_search_thumbnail(webpage),