]>
Commit | Line | Data |
---|---|---|
1 | from .common import InfoExtractor | |
2 | from .vidio import VidioIE | |
3 | ||
4 | ||
5 | class Liputan6IE(InfoExtractor): | |
6 | _VALID_URL = r'https?://www\.liputan6\.com/\w+/read/\d+/(?P<id>[\w-]+)' | |
7 | _TESTS = [{ | |
8 | 'url': 'https://www.liputan6.com/news/read/5007510/video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien', | |
9 | 'info_dict': { | |
10 | 'id': '7082548', | |
11 | 'ext': 'mp4', | |
12 | 'title': 'Duh, Perawat RS di Medan Diduga Salah Berikan Obat Ke Pasien', | |
13 | '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', | |
14 | 'channel_id': '185693', | |
15 | 'uploader': 'Liputan6.com', | |
16 | 'duration': 104, | |
17 | 'uploader_url': 'https://www.vidio.com/@liputan6', | |
18 | 'description': 'md5:3b58ecff10ec3a41d4304cf98228435a', | |
19 | 'timestamp': 1657159427, | |
20 | 'uploader_id': 'liputan6', | |
21 | 'display_id': 'video-duh-perawat-rs-di-medan-diduga-salah-berikan-obat-ke-pasien', | |
22 | 'like_count': int, | |
23 | 'view_count': int, | |
24 | 'comment_count': int, | |
25 | 'tags': ['perawat indonesia', 'rumah sakit', 'Medan', 'viral hari ini', 'viral', 'enamplus'], | |
26 | 'channel': 'Default Channel', | |
27 | 'dislike_count': int, | |
28 | 'upload_date': '20220707', | |
29 | }, | |
30 | }, { | |
31 | 'url': 'https://www.liputan6.com/tv/read/5007719/video-program-minyakita-minyak-goreng-kemasan-sederhana-seharga-rp-14-ribu', | |
32 | 'info_dict': { | |
33 | 'id': '7082543', | |
34 | 'ext': 'mp4', | |
35 | 'title': 'md5:ecb7b3c598b97798bfd0eb50c6233b8c', | |
36 | 'channel_id': '604054', | |
37 | 'dislike_count': int, | |
38 | 'comment_count': int, | |
39 | 'timestamp': 1657159211, | |
40 | 'upload_date': '20220707', | |
41 | 'tags': ['minyakita', 'minyak goreng', 'liputan 6', 'sctv'], | |
42 | 'uploader_url': 'https://www.vidio.com/@sctv', | |
43 | 'display_id': 'video-program-minyakita-minyak-goreng-kemasan-sederhana-seharga-rp-14-ribu', | |
44 | 'like_count': int, | |
45 | 'uploader': 'SCTV', | |
46 | 'description': 'md5:6c374d82589b71fb98b3d550edb6873f', | |
47 | 'duration': 99, | |
48 | 'uploader_id': 'sctv', | |
49 | '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', | |
50 | 'channel': 'Liputan 6 Pagi', | |
51 | 'view_count': int, | |
52 | }, | |
53 | }] | |
54 | ||
55 | def _real_extract(self, url): | |
56 | display_id = self._match_id(url) | |
57 | webpage = self._download_webpage(url, display_id) | |
58 | ||
59 | json_data = self._search_json( | |
60 | r'window.kmklabs.gtm\s*=', webpage, 'json_data', display_id) | |
61 | video_id = json_data['videos']['video_1']['video_id'] | |
62 | ||
63 | return self.url_result( | |
64 | f'https://www.vidio.com/watch/{video_id}-{display_id}', ie=VidioIE, video_id=display_id) |