Repository: yt-dlp/yt-dlp

Issue:
[Liputan6] Add site-support for liputan6.com
### Checklist

- [X] I'm reporting a new site support request
- [X] I've verified that I'm running yt-dlp version **2022.06.29** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [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/ytdl-org/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free) or contain any [DRM](https://en.wikipedia.org/wiki/Digital_rights_management) to the best of my knowledge
- [X] I've searched 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)
- [ ] 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

Indonesia

### Example URLs

Single video: https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien
m3u8 video: https://www.vidio.com/videos/7082548/common_tokenized_playlist.m3u8?embed=true

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

Liputan6 is Indonesian online news provider. This site actually use drm but at same time, this site return hls (m3u8) link from `Vidio`. We can get non-drm video with `video_id` in `window.kmklabs.gtm` variable. Here's the variable that i specified:
```js
window.kmklabs.gtm = {
	"articleId": 5007510,
	"articleTitle": "video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien",
	"category": "article",
	"editors": "Ridi Fadhilah Khan",
	"editorialType": "editorial",
	"embedVideo": "yes",
	"pageTitle": "news - video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien",
	"publicationDate": "2022-07-07",
	"publicationTime": "10:14:47",
	"subCategory": "news",
	"subSubCategory": "",
	"tag": "perawat|Rumah Sakit|medan|Viral|Enam +|enamplus|Enam Plus",
	"authors": {
		"type": "videographer",
		"names": ""
	},
	"numberOfWords": 26,
	"enabled": true,
	"log": false,
	"imageCreation": false,
	"type": "VideoGallery",
	"videos": {
		"video_1": {
			"video_id": "7082548",
			"video_type": "video_gallery",
			"player_type": "widget"
		}
	},
	"photos": [],
	"partner": "",
	"isSEO": false,
	"reporters": "Ridi Fadhilah Khan",
	"photographers": "",
	"isLiveReport": false,
	"liveReportTag": "",
	"audience": "government,-politics-and-law|kids-content|news|national-news",
	"brand": "",
	"videoSource": "Vidio"
};
``` 
We can get `video_id` from this variable and then return `https://www.vidio.com/watch/<video_id>-<slug>` to `VidioIE` 

The hls seems not have drm:
```
C:\Users\USER\Downloads>yt-dlp -vU "https://www.vidio.com/videos/7082548/common_tokenized_playlist.m3u8?embed=true" --test
[debug] Command-line config: ['-vU', 'https://www.vidio.com/videos/7082548/common_tokenized_playlist.m3u8?embed=true', '--test']
[debug] Portable config "C:\Users\ACER\Downloads\yt-dlp\yt-dlp.conf": ['-v', '--netrc-location', 'C:UsersACERDownloadsyt-dlp.netrc', '-f', 'bv+ba/b', '--compat-options', 'format-sort', '--embed-metadata', '--embed-subs', '--sub-langs', 'all', '--console-title', '--downloader', 'aria2c']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.29 [9d339c4] (win32_exe)
[debug] Compatibility options: format-sort
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.0.1-full_build-www.gyan.dev (setts), ffprobe 5.0.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/download/2022.06.29/_update_spec
Latest version: 2022.06.29, Current version: 2022.06.29
yt-dlp is up to date (2022.06.29)
[debug] [generic] Extracting URL: https://www.vidio.com/videos/7082548/common_tokenized_playlist.m3u8?embed=true
[generic] common_tokenized_playlist: Requesting header
[debug] Identified a direct video link
[generic] common_tokenized_playlist: Downloading m3u8 information
[debug] Sort order given by user: hasaud, lang, quality, tbr, filesize, vbr, height, width, proto, vext, abr, aext, fps, fs_approx, source, id
[debug] Formats sorted by: hasvid, ie_pref, hasaud, lang, quality, tbr, filesize, vbr, height, width, proto, vext, abr, aext, fps, fs_approx, source, id, res, hdr:12(7), vcodec:vp9.2(10), acodec, asr
[info] common_tokenized_playlist: Downloading 1 format(s): 720p
[debug] Invoking hlsnative downloader on "https://token-media-vidio-com.akamaized.net/exp=1657276748~acl=/uploads/7082548/*~hmac=369e9501bb64dabe872a83f0f08670a7fef69b0ae3eafe3060ff51988afcbaa8/uploads/7082548/etsvod_ETS2cd5dffe5bb88b918_high.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 15
[download] Destination: common_tokenized_playlist [common_tokenized_playlist].mp4
[debug] File locking is not supported. Proceeding without locking
[download] 100% of 227.11KiB in 00:00
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json "file:common_tokenized_playlist [common_tokenized_playlist].mp4"
[FixupM3u8] Fixing MPEG-TS in MP4 container of "common_tokenized_playlist [common_tokenized_playlist].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:common_tokenized_playlist [common_tokenized_playlist].mp4" -map 0 -dn -ignore_unknown -c copy -f mp4 "-bsf:a" aac_adtstoasc -movflags "+faststart" "file:common_tokenized_playlist [common_tokenized_playlist].temp.mp4"
[EmbedSubtitle] There aren't any subtitles to embed
[Metadata] Adding metadata to "common_tokenized_playlist [common_tokenized_playlist].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:common_tokenized_playlist [common_tokenized_playlist].mp4" -map 0 -dn -ignore_unknown -c copy -write_id3v1 1 -metadata "title=common_tokenized_playlist" -metadata "purl=https://www.vidio.com/videos/7082548/common_tokenized_playlist.m3u8?embed=true" -metadata "comment=https://www.vidio.com/videos/7082548/common_tokenized_playlist.m3u8?embed=true" -movflags "+faststart" "file:common_tokenized_playlist [common_tokenized_playlist].temp.mp4"
```

### 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] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
C:\Users\USER\Downloads>yt-dlp -vU "https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien" --ignore-config
[debug] Command-line config: ['-vU', 'https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien', '--ignore-config']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.29 [9d339c4] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.0.1-full_build-www.gyan.dev (setts), ffprobe 5.0.1-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/download/2022.06.29/_update_spec
Latest version: 2022.06.29, Current version: 2022.06.29
yt-dlp is up to date (2022.06.29)
[debug] [generic] Extracting URL: https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien
[generic] video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien: Downloading webpage
[generic] video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien: Extracting information
[debug] Looking for video embeds
ERROR: Unsupported URL: https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien
Traceback (most recent call last):
  File "yt_dlp\YoutubeDL.py", line 1420, in wrapper
  File "yt_dlp\YoutubeDL.py", line 1490, in __extract_info
  File "yt_dlp\extractor\common.py", line 640, in extract
  File "yt_dlp\extractor\generic.py", line 4130, in _real_extract
yt_dlp.utils.UnsupportedError: Unsupported URL: https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien
```



Discussion:

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
@@ -830,6 +830,7 @@
     LinkedInLearningCourseIE,
 )
 from .linuxacademy import LinuxAcademyIE
+from .liputan6 import Liputan6IE
 from .litv import LiTVIE
 from .livejournal import LiveJournalIE
 from .livestream import (
diff --git a/yt_dlp/extractor/liputan6.py b/yt_dlp/extractor/liputan6.py
new file mode 100644
--- /dev/null
+++ b/yt_dlp/extractor/liputan6.py
@@ -0,0 +1,64 @@
+from .common import InfoExtractor
+from .vidio import VidioIE
+
+
+class Liputan6IE(InfoExtractor):
+    _VALID_URL = r'https?://www\.liputan6\.com/\w+/read/\d+/(?P<id>[\w-]+)'
+    _TESTS = [{
+        'url': 'https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien',
+        'info_dict': {
+            'id': '7082548',
+            'ext': 'mp4',
+            'title': 'Duh, Perawat RS di Medan Diduga Salah Berikan Obat Ke Pasien',
+            'thumbnail': 'https://thumbor.prod.vidiocdn.com/lOz5pStm9X-jjlTa_VQQUelOPtw=/640x360/filters:quality(70)/vidio-web-prod-video/uploads/video/image/7082548/duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien-ca1125.jpg',
+            'channel_id': '185693',
+            'uploader': 'Liputan6.com',
+            'duration': 104,
+            'uploader_url': 'https://www.vidio.com/@liputan6',
+            'description': 'md5:3b58ecff10ec3a41d4304cf98228435a',
+            'timestamp': 1657159427,
+            'uploader_id': 'liputan6',
+            'display_id': 'video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien',
+            'like_count': int,
+            'view_count': int,
+            'comment_count': int,
+            'tags': ['perawat indonesia', 'rumah sakit', 'Medan', 'viral hari ini', 'viral', 'enamplus'],
+            'channel': 'Default Channel',
+            'dislike_count': int,
+            'upload_date': '20220707'
+        }
+    }, {
+        'url': 'https://www.liputan6.com/tv/read/5007719/video-program-minyakita-minyak-goreng-kemasan-sederhana-seharga-rp-14-ribu',
+        'info_dict': {
+            'id': '7082543',
+            'ext': 'mp4',
+            'title': 'md5:ecb7b3c598b97798bfd0eb50c6233b8c',
+            'channel_id': '604054',
+            'dislike_count': int,
+            'comment_count': int,
+            'timestamp': 1657159211,
+            'upload_date': '20220707',
+            'tags': ['minyakita', 'minyak goreng', 'liputan 6', 'sctv'],
+            'uploader_url': 'https://www.vidio.com/@sctv',
+            'display_id': 'video-program-minyakita-minyak-goreng-kemasan-sederhana-seharga-rp-14-ribu',
+            'like_count': int,
+            'uploader': 'SCTV',
+            'description': 'md5:6c374d82589b71fb98b3d550edb6873f',
+            'duration': 99,
+            'uploader_id': 'sctv',
+            'thumbnail': 'https://thumbor.prod.vidiocdn.com/AAIOjz-64hKojjdw5hr0oNNEeJg=/640x360/filters:quality(70)/vidio-web-prod-video/uploads/video/image/7082543/program-minyakita-minyak-goreng-kemasan-sederhana-seharga-rp14-ribu-_-liputan-6-7d9fbb.jpg',
+            'channel': 'Liputan 6 Pagi',
+            'view_count': int,
+        }
+    }]
+
+    def _real_extract(self, url):
+        display_id = self._match_id(url)
+        webpage = self._download_webpage(url, display_id)
+
+        json_data = self._search_json(
+            r'window.kmklabs.gtm\s*=\s*', webpage, 'json_data', display_id)
+        video_id = json_data['videos']['video_1']['video_id']
+
+        return self.url_result(
+            f'https://www.vidio.com/watch/{video_id}-{display_id}', ie=VidioIE, video_id=display_id)


Test patch: