diff --git a/youtube_dl/extractor/detik.py b/youtube_dl/extractor/detik.py index e97745acd..5a298f4f6 100644 --- a/youtube_dl/extractor/detik.py +++ b/youtube_dl/extractor/detik.py @@ -15,7 +15,7 @@ class DuaPuluhDetikIE(InfoExtractor): 'info_dict': { 'id': '180403001', 'title': 'Dahsyatnya Rudal Anti-balistik yang Diuji Coba Rusia', - 'description': '', + 'description': 'md5:909c645cc494f5d9d7089963c13a695d', 'thumbnail': r're:^https?://.*\.jpg(\?.*)?$', 'ext': 'mp4' } @@ -30,6 +30,12 @@ class DuaPuluhDetikIE(InfoExtractor): } }] + @staticmethod + def _extract_urls(webpage): + return [m.group('url') for m in re.finditer( + r'[^\']]+?src=(["\'])(?Phttps?://20\.detik\.com/embed/(\d+)[^"\']+?)\1', + webpage)] + def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('video_id') diff --git a/youtube_dl/extractor/generic.py b/youtube_dl/extractor/generic.py index e9fde09e6..853b0316a 100644 --- a/youtube_dl/extractor/generic.py +++ b/youtube_dl/extractor/generic.py @@ -105,6 +105,7 @@ from .springboardplatform import SpringboardPlatformIE from .yapfiles import YapFilesIE from .vice import ViceIE from .xfileshare import XFileShareIE +from .detik import DuaPuluhDetikIE class GenericIE(InfoExtractor): @@ -2839,11 +2840,9 @@ class GenericIE(InfoExtractor): return info # Look for 20detik (https://20.detik.com) embeds - mobj = re.search( - r']+?src=(["\'])(?Phttps?://20\.detik\.com/embed/(\d+)[^"\']+?)\1', - webpage) - if mobj is not None: - return self.url_result(mobj.group('url')) + duapuluhdetik_urls = DuaPuluhDetikIE._extract_urls(webpage) + if duapuluhdetik_urls: + return self.playlist_from_matches(duapuluhdetik_urls, video_id, video_title, getter=unescapeHTML, ie=DuaPuluhDetikIE.ie_key()) # Look for Instagram embeds instagram_embed_url = InstagramIE._extract_embed_url(webpage)