Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/detik.py (Python)

Code before:
            'upload_date': '20220702',
            'duration': 650,
        }
    }, {
        # viral
        'url': 'https://20.detik.com/viral/20220603-220603135/merasakan-bus-imut-tanpa-pengemudi-muter-muter-di-kawasan-bsd-city',
        'info_dict': {
            'id': '220603135',
            'ext': 'mp4',
            'description': 'md5:4771fe101aa303edb829c59c26f9e7c6',
            'timestamp': 1654279105,
            'title': 'Merasakan Bus Imut Tanpa Pengemudi, Muter-muter di Kawasan BSD City',
            'tags': ['viral', 'autonomous vehicle', 'electric', 'shuttle bus'],
            'thumbnail': 'https://cdnv.detik.com/videoservice/AdminTV/2022/06/03/VIRAL_BUS_NO_SUPIR-20220604004707-custom.jpg?w=650&q=80',
            'duration': 593,
            'upload_date': '20220603'
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        json_ld_data = list(self._yield_json_ld(webpage, display_id))[0]

        video_url = self._html_search_regex(
            r'videoUrl\s*:\s*"(?P<video_url>[/\w+\.:]+)', webpage, 'videoUrl')
        formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_url, display_id, ext='mp4')

        return {
            'id': self._html_search_meta('video_id', webpage),
            'formats': formats,
            'subtitles': subtitles,
            'title': json_ld_data.get('name') or self._og_search_title(webpage) or self._html_extract_title(webpage),
            'description': json_ld_data.get('description') or self._og_search_description(webpage) or self._html_search_meta('description', webpage),
            'thumbnail': json_ld_data.get('thumbnailUrl') or self._og_search_thumbnail(webpage),
            'tags': str_or_none(json_ld_data.get('keywords') or self._html_search_meta(['keywords', 'keyword', 'dtk:keywords'], webpage), '').split(','),
            'duration': int_or_none(self._html_search_meta('duration', webpage)),
            'timestamp': int_or_none(self._html_search_meta('dtk:publishdateunix', webpage), 1000)
        }


Review comment (suggestion):
```suggestion
            r'videoUrl\s*:\s*"(?P<video_url>[^"]+)', webpage, 'videoUrl')
```

Code after:
            'upload_date': '20220703',
            'duration': 650,
        }
    }, {
        # viral
        'url': 'https://20.detik.com/viral/20220603-220603135/merasakan-bus-imut-tanpa-pengemudi-muter-muter-di-kawasan-bsd-city',
        'info_dict': {
            'id': '220603135',
            'ext': 'mp4',
            'description': 'md5:4771fe101aa303edb829c59c26f9e7c6',
            'timestamp': 1654304305,
            'title': 'Merasakan Bus Imut Tanpa Pengemudi, Muter-muter di Kawasan BSD City',
            'tags': ['viral', 'autonomous vehicle', 'electric', 'shuttle bus'],
            'thumbnail': 'https://cdnv.detik.com/videoservice/AdminTV/2022/06/03/VIRAL_BUS_NO_SUPIR-20220604004707-custom.jpg?w=650&q=80',
            'duration': 593,
            'upload_date': '20220604',
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        webpage = self._download_webpage(url, display_id)
        json_ld_data = self._search_json_ld(webpage, display_id)

        video_url = self._html_search_regex(
            r'videoUrl\s*:\s*"(?P<video_url>[^"]+)', webpage, 'videoUrl')
        formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_url, display_id, ext='mp4')

        return merge_dicts(json_ld_data, {
            'id': self._html_search_meta('video_id', webpage),
            'formats': formats,
            'subtitles': subtitles,
            'tags': str_or_none(self._html_search_meta(['keywords', 'keyword', 'dtk:keywords'], webpage), '').split(','),
        })