We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
720p ABC iView
<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.10.29. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Search the bugtracker for similar site feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a site feature request
- [x] I've verified that I'm running youtube-dl version **2019.10.29**
- [x] I've searched the bugtracker for similar site feature requests including closed ones


## Description

<!--
Provide an explanation of your site feature request in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
-->

WRITE DESCRIPTION HERE

ABC iView has recently started streaming a lot of their stuff in 720p. Youtube-dl doesn't pick up the 720p videos and only downloads 540p. If you could get 720p ABC iView downloading on youtube-dl that would be awesome! Thanks!

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `youtube_dl/extractor/abc.py`
Content:
```
1 from __future__ import unicode_literals
2 
3 import hashlib
4 import hmac
5 import re
6 import time
7 
8 from .common import InfoExtractor
9 from ..compat import compat_str
10 from ..utils import (
11     ExtractorError,
12     js_to_json,
13     int_or_none,
14     parse_iso8601,
15     try_get,
16     unescapeHTML,
17     update_url_query,
18 )
19 
20 
21 class ABCIE(InfoExtractor):
22     IE_NAME = 'abc.net.au'
23     _VALID_URL = r'https?://(?:www\.)?abc\.net\.au/news/(?:[^/]+/){1,2}(?P<id>\d+)'
24 
25     _TESTS = [{
26         'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebola-treatment-centre-in-sierra-leone/5868334',
27         'md5': 'cb3dd03b18455a661071ee1e28344d9f',
28         'info_dict': {
29             'id': '5868334',
30             'ext': 'mp4',
31             'title': 'Australia to help staff Ebola treatment centre in Sierra Leone',
32             'description': 'md5:809ad29c67a05f54eb41f2a105693a67',
33         },
34         'skip': 'this video has expired',
35     }, {
36         'url': 'http://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326',
37         'md5': 'db2a5369238b51f9811ad815b69dc086',
38         'info_dict': {
39             'id': 'NvqvPeNZsHU',
40             'ext': 'mp4',
41             'upload_date': '20150816',
42             'uploader': 'ABC News (Australia)',
43             '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',
44             'uploader_id': 'NewsOnABC',
45             'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill',
46         },
47         'add_ie': ['Youtube'],
48         'skip': 'Not accessible from Travis CI server',
49     }, {
50         'url': 'http://www.abc.net.au/news/2015-10-23/nab-lifts-interest-rates-following-westpac-and-cba/6880080',
51         'md5': 'b96eee7c9edf4fc5a358a0252881cc1f',
52         'info_dict': {
53             'id': '6880080',
54             'ext': 'mp3',
55             'title': 'NAB lifts interest rates, following Westpac and CBA',
56             'description': 'md5:f13d8edc81e462fce4a0437c7dc04728',
57         },
58     }, {
59         'url': 'http://www.abc.net.au/news/2015-10-19/6866214',
60         'only_matching': True,
61     }]
62 
63     def _real_extract(self, url):
64         video_id = self._match_id(url)
65         webpage = self._download_webpage(url, video_id)
66 
67         mobj = re.search(
68             r'inline(?P<type>Video|Audio|YouTube)Data\.push\((?P<json_data>[^)]+)\);',
69             webpage)
70         if mobj is None:
71             expired = self._html_search_regex(r'(?s)class="expired-(?:video|audio)".+?<span>(.+?)</span>', webpage, 'expired', None)
72             if expired:
73                 raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True)
74             raise ExtractorError('Unable to extract video urls')
75 
76         urls_info = self._parse_json(
77             mobj.group('json_data'), video_id, transform_source=js_to_json)
78 
79         if not isinstance(urls_info, list):
80             urls_info = [urls_info]
81 
82         if mobj.group('type') == 'YouTube':
83             return self.playlist_result([
84                 self.url_result(url_info['url']) for url_info in urls_info])
85 
86         formats = [{
87             'url': url_info['url'],
88             'vcodec': url_info.get('codec') if mobj.group('type') == 'Video' else 'none',
89             'width': int_or_none(url_info.get('width')),
90             'height': int_or_none(url_info.get('height')),
91             'tbr': int_or_none(url_info.get('bitrate')),
92             'filesize': int_or_none(url_info.get('filesize')),
93         } for url_info in urls_info]
94 
95         self._sort_formats(formats)
96 
97         return {
98             'id': video_id,
99             'title': self._og_search_title(webpage),
100             'formats': formats,
101             'description': self._og_search_description(webpage),
102             'thumbnail': self._og_search_thumbnail(webpage),
103         }
104 
105 
106 class ABCIViewIE(InfoExtractor):
107     IE_NAME = 'abc.net.au:iview'
108     _VALID_URL = r'https?://iview\.abc\.net\.au/(?:[^/]+/)*video/(?P<id>[^/?#]+)'
109     _GEO_COUNTRIES = ['AU']
110 
111     # ABC iview programs are normally available for 14 days only.
112     _TESTS = [{
113         'url': 'https://iview.abc.net.au/show/ben-and-hollys-little-kingdom/series/0/video/ZX9371A050S00',
114         'md5': 'cde42d728b3b7c2b32b1b94b4a548afc',
115         'info_dict': {
116             'id': 'ZX9371A050S00',
117             'ext': 'mp4',
118             'title': "Gaston's Birthday",
119             'series': "Ben And Holly's Little Kingdom",
120             'description': 'md5:f9de914d02f226968f598ac76f105bcf',
121             'upload_date': '20180604',
122             'uploader_id': 'abc4kids',
123             'timestamp': 1528140219,
124         },
125         'params': {
126             'skip_download': True,
127         },
128     }]
129 
130     def _real_extract(self, url):
131         video_id = self._match_id(url)
132         video_params = self._download_json(
133             'https://iview.abc.net.au/api/programs/' + video_id, video_id)
134         title = unescapeHTML(video_params.get('title') or video_params['seriesTitle'])
135         stream = next(s for s in video_params['playlist'] if s.get('type') in ('program', 'livestream'))
136 
137         house_number = video_params.get('episodeHouseNumber') or video_id
138         path = '/auth/hls/sign?ts={0}&hn={1}&d=android-tablet'.format(
139             int(time.time()), house_number)
140         sig = hmac.new(
141             b'android.content.res.Resources',
142             path.encode('utf-8'), hashlib.sha256).hexdigest()
143         token = self._download_webpage(
144             'http://iview.abc.net.au{0}&sig={1}'.format(path, sig), video_id)
145 
146         def tokenize_url(url, token):
147             return update_url_query(url, {
148                 'hdnea': token,
149             })
150 
151         for sd in ('sd', 'sd-low'):
152             sd_url = try_get(
153                 stream, lambda x: x['streams']['hls'][sd], compat_str)
154             if not sd_url:
155                 continue
156             formats = self._extract_m3u8_formats(
157                 tokenize_url(sd_url, token), video_id, 'mp4',
158                 entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
159             if formats:
160                 break
161         self._sort_formats(formats)
162 
163         subtitles = {}
164         src_vtt = stream.get('captions', {}).get('src-vtt')
165         if src_vtt:
166             subtitles['en'] = [{
167                 'url': src_vtt,
168                 'ext': 'vtt',
169             }]
170 
171         is_live = video_params.get('livestream') == '1'
172         if is_live:
173             title = self._live_title(title)
174 
175         return {
176             'id': video_id,
177             'title': title,
178             'description': video_params.get('description'),
179             'thumbnail': video_params.get('thumbnail'),
180             'duration': int_or_none(video_params.get('eventDuration')),
181             'timestamp': parse_iso8601(video_params.get('pubDate'), ' '),
182             'series': unescapeHTML(video_params.get('seriesTitle')),
183             'series_id': video_params.get('seriesHouseNumber') or video_id[:7],
184             'season_number': int_or_none(self._search_regex(
185                 r'\bSeries\s+(\d+)\b', title, 'season number', default=None)),
186             'episode_number': int_or_none(self._search_regex(
187                 r'\bEp\s+(\d+)\b', title, 'episode number', default=None)),
188             'episode_id': house_number,
189             'uploader_id': video_params.get('channel'),
190             'formats': formats,
191             'subtitles': subtitles,
192             'is_live': is_live,
193         }
194
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/youtube_dl/extractor/abc.py b/youtube_dl/extractor/abc.py
--- a/youtube_dl/extractor/abc.py
+++ b/youtube_dl/extractor/abc.py
@@ -110,17 +110,17 @@
 
     # ABC iview programs are normally available for 14 days only.
     _TESTS = [{
-        'url': 'https://iview.abc.net.au/show/ben-and-hollys-little-kingdom/series/0/video/ZX9371A050S00',
-        'md5': 'cde42d728b3b7c2b32b1b94b4a548afc',
+        'url': 'https://iview.abc.net.au/show/gruen/series/11/video/LE1927H001S00',
+        'md5': '67715ce3c78426b11ba167d875ac6abf',
         'info_dict': {
-            'id': 'ZX9371A050S00',
+            'id': 'LE1927H001S00',
             'ext': 'mp4',
-            'title': "Gaston's Birthday",
-            'series': "Ben And Holly's Little Kingdom",
-            'description': 'md5:f9de914d02f226968f598ac76f105bcf',
-            'upload_date': '20180604',
-            'uploader_id': 'abc4kids',
-            'timestamp': 1528140219,
+            'title': "Series 11 Ep 1",
+            'series': "Gruen",
+            'description': 'md5:52cc744ad35045baf6aded2ce7287f67',
+            'upload_date': '20190925',
+            'uploader_id': 'abc1',
+            'timestamp': 1569445289,
         },
         'params': {
             'skip_download': True,
@@ -148,7 +148,7 @@
                 'hdnea': token,
             })
 
-        for sd in ('sd', 'sd-low'):
+        for sd in ('720', 'sd', 'sd-low'):
             sd_url = try_get(
                 stream, lambda x: x['streams']['hls'][sd], compat_str)
             if not sd_url:

{"golden_diff": "diff --git a/youtube_dl/extractor/abc.py b/youtube_dl/extractor/abc.py\n--- a/youtube_dl/extractor/abc.py\n+++ b/youtube_dl/extractor/abc.py\n@@ -110,17 +110,17 @@\n \n     # ABC iview programs are normally available for 14 days only.\n     _TESTS = [{\n-        'url': 'https://iview.abc.net.au/show/ben-and-hollys-little-kingdom/series/0/video/ZX9371A050S00',\n-        'md5': 'cde42d728b3b7c2b32b1b94b4a548afc',\n+        'url': 'https://iview.abc.net.au/show/gruen/series/11/video/LE1927H001S00',\n+        'md5': '67715ce3c78426b11ba167d875ac6abf',\n         'info_dict': {\n-            'id': 'ZX9371A050S00',\n+            'id': 'LE1927H001S00',\n             'ext': 'mp4',\n-            'title': \"Gaston's Birthday\",\n-            'series': \"Ben And Holly's Little Kingdom\",\n-            'description': 'md5:f9de914d02f226968f598ac76f105bcf',\n-            'upload_date': '20180604',\n-            'uploader_id': 'abc4kids',\n-            'timestamp': 1528140219,\n+            'title': \"Series 11 Ep 1\",\n+            'series': \"Gruen\",\n+            'description': 'md5:52cc744ad35045baf6aded2ce7287f67',\n+            'upload_date': '20190925',\n+            'uploader_id': 'abc1',\n+            'timestamp': 1569445289,\n         },\n         'params': {\n             'skip_download': True,\n@@ -148,7 +148,7 @@\n                 'hdnea': token,\n             })\n \n-        for sd in ('sd', 'sd-low'):\n+        for sd in ('720', 'sd', 'sd-low'):\n             sd_url = try_get(\n                 stream, lambda x: x['streams']['hls'][sd], compat_str)\n             if not sd_url:\n", "issue": "720p ABC iView\n<!--\r\n\r\n######################################################################\r\n  WARNING!\r\n  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE\r\n######################################################################\r\n\r\n-->\r\n\r\n\r\n## Checklist\r\n\r\n<!--\r\nCarefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:\r\n- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.10.29. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.\r\n- Search the bugtracker for similar site feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates.\r\n- Finally, put x into all relevant boxes (like this [x])\r\n-->\r\n\r\n- [x] I'm reporting a site feature request\r\n- [x] I've verified that I'm running youtube-dl version **2019.10.29**\r\n- [x] I've searched the bugtracker for similar site feature requests including closed ones\r\n\r\n\r\n## Description\r\n\r\n<!--\r\nProvide an explanation of your site feature request in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.\r\n-->\r\n\r\nWRITE DESCRIPTION HERE\r\n\r\nABC iView has recently started streaming a lot of their stuff in 720p. Youtube-dl doesn't pick up the 720p videos and only downloads 540p. If you could get 720p ABC iView downloading on youtube-dl that would be awesome! Thanks!\n", "before_files": [{"content": "from __future__ import unicode_literals\n\nimport hashlib\nimport hmac\nimport re\nimport time\n\nfrom .common import InfoExtractor\nfrom ..compat import compat_str\nfrom ..utils import (\n    ExtractorError,\n    js_to_json,\n    int_or_none,\n    parse_iso8601,\n    try_get,\n    unescapeHTML,\n    update_url_query,\n)\n\n\nclass ABCIE(InfoExtractor):\n    IE_NAME = 'abc.net.au'\n    _VALID_URL = r'https?://(?:www\\.)?abc\\.net\\.au/news/(?:[^/]+/){1,2}(?P<id>\\d+)'\n\n    _TESTS = [{\n        'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebola-treatment-centre-in-sierra-leone/5868334',\n        'md5': 'cb3dd03b18455a661071ee1e28344d9f',\n        'info_dict': {\n            'id': '5868334',\n            'ext': 'mp4',\n            'title': 'Australia to help staff Ebola treatment centre in Sierra Leone',\n            'description': 'md5:809ad29c67a05f54eb41f2a105693a67',\n        },\n        'skip': 'this video has expired',\n    }, {\n        'url': 'http://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326',\n        'md5': 'db2a5369238b51f9811ad815b69dc086',\n        'info_dict': {\n            'id': 'NvqvPeNZsHU',\n            'ext': 'mp4',\n            'upload_date': '20150816',\n            'uploader': 'ABC News (Australia)',\n            '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',\n            'uploader_id': 'NewsOnABC',\n            'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill',\n        },\n        'add_ie': ['Youtube'],\n        'skip': 'Not accessible from Travis CI server',\n    }, {\n        'url': 'http://www.abc.net.au/news/2015-10-23/nab-lifts-interest-rates-following-westpac-and-cba/6880080',\n        'md5': 'b96eee7c9edf4fc5a358a0252881cc1f',\n        'info_dict': {\n            'id': '6880080',\n            'ext': 'mp3',\n            'title': 'NAB lifts interest rates, following Westpac and CBA',\n            'description': 'md5:f13d8edc81e462fce4a0437c7dc04728',\n        },\n    }, {\n        'url': 'http://www.abc.net.au/news/2015-10-19/6866214',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n\n        mobj = re.search(\n            r'inline(?P<type>Video|Audio|YouTube)Data\\.push\\((?P<json_data>[^)]+)\\);',\n            webpage)\n        if mobj is None:\n            expired = self._html_search_regex(r'(?s)class=\"expired-(?:video|audio)\".+?<span>(.+?)</span>', webpage, 'expired', None)\n            if expired:\n                raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True)\n            raise ExtractorError('Unable to extract video urls')\n\n        urls_info = self._parse_json(\n            mobj.group('json_data'), video_id, transform_source=js_to_json)\n\n        if not isinstance(urls_info, list):\n            urls_info = [urls_info]\n\n        if mobj.group('type') == 'YouTube':\n            return self.playlist_result([\n                self.url_result(url_info['url']) for url_info in urls_info])\n\n        formats = [{\n            'url': url_info['url'],\n            'vcodec': url_info.get('codec') if mobj.group('type') == 'Video' else 'none',\n            'width': int_or_none(url_info.get('width')),\n            'height': int_or_none(url_info.get('height')),\n            'tbr': int_or_none(url_info.get('bitrate')),\n            'filesize': int_or_none(url_info.get('filesize')),\n        } for url_info in urls_info]\n\n        self._sort_formats(formats)\n\n        return {\n            'id': video_id,\n            'title': self._og_search_title(webpage),\n            'formats': formats,\n            'description': self._og_search_description(webpage),\n            'thumbnail': self._og_search_thumbnail(webpage),\n        }\n\n\nclass ABCIViewIE(InfoExtractor):\n    IE_NAME = 'abc.net.au:iview'\n    _VALID_URL = r'https?://iview\\.abc\\.net\\.au/(?:[^/]+/)*video/(?P<id>[^/?#]+)'\n    _GEO_COUNTRIES = ['AU']\n\n    # ABC iview programs are normally available for 14 days only.\n    _TESTS = [{\n        'url': 'https://iview.abc.net.au/show/ben-and-hollys-little-kingdom/series/0/video/ZX9371A050S00',\n        'md5': 'cde42d728b3b7c2b32b1b94b4a548afc',\n        'info_dict': {\n            'id': 'ZX9371A050S00',\n            'ext': 'mp4',\n            'title': \"Gaston's Birthday\",\n            'series': \"Ben And Holly's Little Kingdom\",\n            'description': 'md5:f9de914d02f226968f598ac76f105bcf',\n            'upload_date': '20180604',\n            'uploader_id': 'abc4kids',\n            'timestamp': 1528140219,\n        },\n        'params': {\n            'skip_download': True,\n        },\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        video_params = self._download_json(\n            'https://iview.abc.net.au/api/programs/' + video_id, video_id)\n        title = unescapeHTML(video_params.get('title') or video_params['seriesTitle'])\n        stream = next(s for s in video_params['playlist'] if s.get('type') in ('program', 'livestream'))\n\n        house_number = video_params.get('episodeHouseNumber') or video_id\n        path = '/auth/hls/sign?ts={0}&hn={1}&d=android-tablet'.format(\n            int(time.time()), house_number)\n        sig = hmac.new(\n            b'android.content.res.Resources',\n            path.encode('utf-8'), hashlib.sha256).hexdigest()\n        token = self._download_webpage(\n            'http://iview.abc.net.au{0}&sig={1}'.format(path, sig), video_id)\n\n        def tokenize_url(url, token):\n            return update_url_query(url, {\n                'hdnea': token,\n            })\n\n        for sd in ('sd', 'sd-low'):\n            sd_url = try_get(\n                stream, lambda x: x['streams']['hls'][sd], compat_str)\n            if not sd_url:\n                continue\n            formats = self._extract_m3u8_formats(\n                tokenize_url(sd_url, token), video_id, 'mp4',\n                entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)\n            if formats:\n                break\n        self._sort_formats(formats)\n\n        subtitles = {}\n        src_vtt = stream.get('captions', {}).get('src-vtt')\n        if src_vtt:\n            subtitles['en'] = [{\n                'url': src_vtt,\n                'ext': 'vtt',\n            }]\n\n        is_live = video_params.get('livestream') == '1'\n        if is_live:\n            title = self._live_title(title)\n\n        return {\n            'id': video_id,\n            'title': title,\n            'description': video_params.get('description'),\n            'thumbnail': video_params.get('thumbnail'),\n            'duration': int_or_none(video_params.get('eventDuration')),\n            'timestamp': parse_iso8601(video_params.get('pubDate'), ' '),\n            'series': unescapeHTML(video_params.get('seriesTitle')),\n            'series_id': video_params.get('seriesHouseNumber') or video_id[:7],\n            'season_number': int_or_none(self._search_regex(\n                r'\\bSeries\\s+(\\d+)\\b', title, 'season number', default=None)),\n            'episode_number': int_or_none(self._search_regex(\n                r'\\bEp\\s+(\\d+)\\b', title, 'episode number', default=None)),\n            'episode_id': house_number,\n            'uploader_id': video_params.get('channel'),\n            'formats': formats,\n            'subtitles': subtitles,\n            'is_live': is_live,\n        }\n", "path": "youtube_dl/extractor/abc.py"}], "after_files": [{"content": "from __future__ import unicode_literals\n\nimport hashlib\nimport hmac\nimport re\nimport time\n\nfrom .common import InfoExtractor\nfrom ..compat import compat_str\nfrom ..utils import (\n    ExtractorError,\n    js_to_json,\n    int_or_none,\n    parse_iso8601,\n    try_get,\n    unescapeHTML,\n    update_url_query,\n)\n\n\nclass ABCIE(InfoExtractor):\n    IE_NAME = 'abc.net.au'\n    _VALID_URL = r'https?://(?:www\\.)?abc\\.net\\.au/news/(?:[^/]+/){1,2}(?P<id>\\d+)'\n\n    _TESTS = [{\n        'url': 'http://www.abc.net.au/news/2014-11-05/australia-to-staff-ebola-treatment-centre-in-sierra-leone/5868334',\n        'md5': 'cb3dd03b18455a661071ee1e28344d9f',\n        'info_dict': {\n            'id': '5868334',\n            'ext': 'mp4',\n            'title': 'Australia to help staff Ebola treatment centre in Sierra Leone',\n            'description': 'md5:809ad29c67a05f54eb41f2a105693a67',\n        },\n        'skip': 'this video has expired',\n    }, {\n        'url': 'http://www.abc.net.au/news/2015-08-17/warren-entsch-introduces-same-sex-marriage-bill/6702326',\n        'md5': 'db2a5369238b51f9811ad815b69dc086',\n        'info_dict': {\n            'id': 'NvqvPeNZsHU',\n            'ext': 'mp4',\n            'upload_date': '20150816',\n            'uploader': 'ABC News (Australia)',\n            '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',\n            'uploader_id': 'NewsOnABC',\n            'title': 'Marriage Equality: Warren Entsch introduces same sex marriage bill',\n        },\n        'add_ie': ['Youtube'],\n        'skip': 'Not accessible from Travis CI server',\n    }, {\n        'url': 'http://www.abc.net.au/news/2015-10-23/nab-lifts-interest-rates-following-westpac-and-cba/6880080',\n        'md5': 'b96eee7c9edf4fc5a358a0252881cc1f',\n        'info_dict': {\n            'id': '6880080',\n            'ext': 'mp3',\n            'title': 'NAB lifts interest rates, following Westpac and CBA',\n            'description': 'md5:f13d8edc81e462fce4a0437c7dc04728',\n        },\n    }, {\n        'url': 'http://www.abc.net.au/news/2015-10-19/6866214',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        webpage = self._download_webpage(url, video_id)\n\n        mobj = re.search(\n            r'inline(?P<type>Video|Audio|YouTube)Data\\.push\\((?P<json_data>[^)]+)\\);',\n            webpage)\n        if mobj is None:\n            expired = self._html_search_regex(r'(?s)class=\"expired-(?:video|audio)\".+?<span>(.+?)</span>', webpage, 'expired', None)\n            if expired:\n                raise ExtractorError('%s said: %s' % (self.IE_NAME, expired), expected=True)\n            raise ExtractorError('Unable to extract video urls')\n\n        urls_info = self._parse_json(\n            mobj.group('json_data'), video_id, transform_source=js_to_json)\n\n        if not isinstance(urls_info, list):\n            urls_info = [urls_info]\n\n        if mobj.group('type') == 'YouTube':\n            return self.playlist_result([\n                self.url_result(url_info['url']) for url_info in urls_info])\n\n        formats = [{\n            'url': url_info['url'],\n            'vcodec': url_info.get('codec') if mobj.group('type') == 'Video' else 'none',\n            'width': int_or_none(url_info.get('width')),\n            'height': int_or_none(url_info.get('height')),\n            'tbr': int_or_none(url_info.get('bitrate')),\n            'filesize': int_or_none(url_info.get('filesize')),\n        } for url_info in urls_info]\n\n        self._sort_formats(formats)\n\n        return {\n            'id': video_id,\n            'title': self._og_search_title(webpage),\n            'formats': formats,\n            'description': self._og_search_description(webpage),\n            'thumbnail': self._og_search_thumbnail(webpage),\n        }\n\n\nclass ABCIViewIE(InfoExtractor):\n    IE_NAME = 'abc.net.au:iview'\n    _VALID_URL = r'https?://iview\\.abc\\.net\\.au/(?:[^/]+/)*video/(?P<id>[^/?#]+)'\n    _GEO_COUNTRIES = ['AU']\n\n    # ABC iview programs are normally available for 14 days only.\n    _TESTS = [{\n        'url': 'https://iview.abc.net.au/show/gruen/series/11/video/LE1927H001S00',\n        'md5': '67715ce3c78426b11ba167d875ac6abf',\n        'info_dict': {\n            'id': 'LE1927H001S00',\n            'ext': 'mp4',\n            'title': \"Series 11 Ep 1\",\n            'series': \"Gruen\",\n            'description': 'md5:52cc744ad35045baf6aded2ce7287f67',\n            'upload_date': '20190925',\n            'uploader_id': 'abc1',\n            'timestamp': 1569445289,\n        },\n        'params': {\n            'skip_download': True,\n        },\n    }]\n\n    def _real_extract(self, url):\n        video_id = self._match_id(url)\n        video_params = self._download_json(\n            'https://iview.abc.net.au/api/programs/' + video_id, video_id)\n        title = unescapeHTML(video_params.get('title') or video_params['seriesTitle'])\n        stream = next(s for s in video_params['playlist'] if s.get('type') in ('program', 'livestream'))\n\n        house_number = video_params.get('episodeHouseNumber') or video_id\n        path = '/auth/hls/sign?ts={0}&hn={1}&d=android-tablet'.format(\n            int(time.time()), house_number)\n        sig = hmac.new(\n            b'android.content.res.Resources',\n            path.encode('utf-8'), hashlib.sha256).hexdigest()\n        token = self._download_webpage(\n            'http://iview.abc.net.au{0}&sig={1}'.format(path, sig), video_id)\n\n        def tokenize_url(url, token):\n            return update_url_query(url, {\n                'hdnea': token,\n            })\n\n        for sd in ('720', 'sd', 'sd-low'):\n            sd_url = try_get(\n                stream, lambda x: x['streams']['hls'][sd], compat_str)\n            if not sd_url:\n                continue\n            formats = self._extract_m3u8_formats(\n                tokenize_url(sd_url, token), video_id, 'mp4',\n                entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)\n            if formats:\n                break\n        self._sort_formats(formats)\n\n        subtitles = {}\n        src_vtt = stream.get('captions', {}).get('src-vtt')\n        if src_vtt:\n            subtitles['en'] = [{\n                'url': src_vtt,\n                'ext': 'vtt',\n            }]\n\n        is_live = video_params.get('livestream') == '1'\n        if is_live:\n            title = self._live_title(title)\n\n        return {\n            'id': video_id,\n            'title': title,\n            'description': video_params.get('description'),\n            'thumbnail': video_params.get('thumbnail'),\n            'duration': int_or_none(video_params.get('eventDuration')),\n            'timestamp': parse_iso8601(video_params.get('pubDate'), ' '),\n            'series': unescapeHTML(video_params.get('seriesTitle')),\n            'series_id': video_params.get('seriesHouseNumber') or video_id[:7],\n            'season_number': int_or_none(self._search_regex(\n                r'\\bSeries\\s+(\\d+)\\b', title, 'season number', default=None)),\n            'episode_number': int_or_none(self._search_regex(\n                r'\\bEp\\s+(\\d+)\\b', title, 'episode number', default=None)),\n            'episode_id': house_number,\n            'uploader_id': video_params.get('channel'),\n            'formats': formats,\n            'subtitles': subtitles,\n            'is_live': is_live,\n        }\n", "path": "youtube_dl/extractor/abc.py"}]}