Repository: yt-dlp/yt-dlp

Issue:
9news.com.au site support
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting a new site support request
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that none of provided URLs [violate any copyrights](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#is-the-website-primarily-used-for-piracy) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and am willing to share it if required

### Region

Australia

### Example URLs

- Single video: https://www.9news.com.au/videos/national/fair-trading-pulls-dozens-of-toys-from-shelves/clqgc7dvj000y0jnvfism0w5m

### Provide a description that is worded well enough to be understood

I'm not really very good with programming, so I may not be much help, but support for this site would be very nice :)

### Provide verbose output that clearly demonstrates the problem

- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
[debug] Command-line config: ['-vU', 'https://www.9news.com.au/videos/national/fair-trading-pulls-dozens-of-toys-from-shelves/clqgc7dvj000y0jnvfism0w5m']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2023.12.21.232720 from yt-dlp/yt-dlp-nightly-builds [632b8ee54] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 2023-01-09-git-13d04e30d7-full_build-www.gyan.dev (setts), ffprobe 2023-01-09-git-13d04e30d7-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.35.5, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1796 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Latest version: nightly@2023.12.21.232720 from yt-dlp/yt-dlp-nightly-builds
yt-dlp is up to date (nightly@2023.12.21.232720 from yt-dlp/yt-dlp-nightly-builds)
[generic] Extracting URL: https://www.9news.com.au/videos/national/fair-trading-pulls-dozens-of-toys-from-shelves/clqgc7dvj000y0jnvfism0w5m
[generic] clqgc7dvj000y0jnvfism0w5m: Downloading webpage
WARNING: [generic] Falling back on generic information extractor
[generic] clqgc7dvj000y0jnvfism0w5m: Extracting information
[debug] Looking for embeds
ERROR: Unsupported URL: https://www.9news.com.au/videos/national/fair-trading-pulls-dozens-of-toys-from-shelves/clqgc7dvj000y0jnvfism0w5m
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1581, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1716, in __extract_info
  File "yt_dlp\extractor\common.py", line 718, in extract
  File "yt_dlp\extractor\generic.py", line 2531, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.9news.com.au/videos/national/fair-trading-pulls-dozens-of-toys-from-shelves/clqgc7dvj000y0jnvfism0w5m
```



Discussion:
I'm working on this one.
> I'm working on this one.

Thank you mate!! Absolute legend

Resolving patch:
diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py
--- a/yt_dlp/extractor/_extractors.py
+++ b/yt_dlp/extractor/_extractors.py
@@ -1262,6 +1262,7 @@
     NiconicoChannelPlusChannelLivesIE,
 )
 from .ninegag import NineGagIE
+from .ninenews import NineNewsIE
 from .ninenow import NineNowIE
 from .nintendo import NintendoIE
 from .nitter import NitterIE
diff --git a/yt_dlp/extractor/ninenews.py b/yt_dlp/extractor/ninenews.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/ninenews.py
@@ -0,0 +1,72 @@
+from .common import InfoExtractor
+from .brightcove import BrightcoveNewIE
+from ..utils import ExtractorError
+from ..utils.traversal import traverse_obj
+
+
+class NineNewsIE(InfoExtractor):
+    IE_NAME = '9News'
+    _VALID_URL = r'https?://(?:www\.)?9news\.com\.au/(?:[\w-]+/){2,3}(?P<id>[\w-]+)/?(?:$|[?#])'
+    _TESTS = [{
+        'url': 'https://www.9news.com.au/videos/national/fair-trading-pulls-dozens-of-toys-from-shelves/clqgc7dvj000y0jnvfism0w5m',
+        'md5': 'd1a65b2e9d126e5feb9bc5cb96e62c80',
+        'info_dict': {
+            'id': '6343717246112',
+            'ext': 'mp4',
+            'title': 'Fair Trading pulls dozens of toys from shelves',
+            'description': 'Fair Trading Australia have been forced to pull dozens of toys from shelves over hazard fears.',
+            'thumbnail': 'md5:bdbe44294e2323b762d97acf8843f66c',
+            'duration': 93.44,
+            'timestamp': 1703231748,
+            'upload_date': '20231222',
+            'uploader_id': '664969388001',
+            'tags': ['networkclip', 'aunews_aunationalninenews', 'christmas presents', 'toys', 'fair trading', 'au_news'],
+        }
+    }, {
+        'url': 'https://www.9news.com.au/world/tape-reveals-donald-trump-pressured-michigan-officials-not-to-certify-2020-vote-a-new-report-says/0b8b880e-7d3c-41b9-b2bd-55bc7e492259',
+        'md5': 'a885c44d20898c3e70e9a53e8188cea1',
+        'info_dict': {
+            'id': '6343587450112',
+            'ext': 'mp4',
+            'title': 'Trump found ineligible to run for president by state court',
+            'description': 'md5:40e6e7db7a4ac6be0e960569a5af6066',
+            'thumbnail': 'md5:3e132c48c186039fd06c10787de9bff2',
+            'duration': 104.64,
+            'timestamp': 1703058034,
+            'upload_date': '20231220',
+            'uploader_id': '664969388001',
+            'tags': ['networkclip', 'aunews_aunationalninenews', 'ineligible', 'presidential candidate', 'donald trump', 'au_news'],
+        }
+    }, {
+        'url': 'https://www.9news.com.au/national/outrage-as-parents-banned-from-giving-gifts-to-kindergarten-teachers/e19b49d4-a1a4-4533-9089-6e10e2d9386a',
+        'info_dict': {
+            'id': '6343716797112',
+            'ext': 'mp4',
+            'title': 'Outrage as parents banned from giving gifts to kindergarten teachers',
+            'description': 'md5:7a8b0ed2f9e08875fd9a3e86e462bc46',
+            'thumbnail': 'md5:5ee4d66717bdd0dee9fc9a705ef041b8',
+            'duration': 91.307,
+            'timestamp': 1703229584,
+            'upload_date': '20231222',
+            'uploader_id': '664969388001',
+            'tags': ['networkclip', 'aunews_aunationalninenews', 'presents', 'teachers', 'kindergarten', 'au_news'],
+        },
+    }]
+
+    def _real_extract(self, url):
+        article_id = self._match_id(url)
+        webpage = self._download_webpage(url, article_id)
+        initial_state = self._search_json(
+            r'var\s+__INITIAL_STATE__\s*=', webpage, 'initial state', article_id)
+        video_id = traverse_obj(
+            initial_state, ('videoIndex', 'currentVideo', 'brightcoveId', {str}),
+            ('article', ..., 'media', lambda _, v: v['type'] == 'video', 'urn', {str}), get_all=False)
+        account = traverse_obj(initial_state, (
+            'videoIndex', 'config', (None, 'video'), 'account', {str}), get_all=False)
+
+        if not video_id or not account:
+            raise ExtractorError('Unable to get the required video data')
+
+        return self.url_result(
+            f'https://players.brightcove.net/{account}/default_default/index.html?videoId={video_id}',
+            BrightcoveNewIE, video_id)


Test patch: