From 9dd91758aea6b3427662cac1efde1c5b5c1de6c3 Mon Sep 17 00:00:00 2001 From: dirkf Date: Sat, 4 Jun 2022 09:26:41 +0100 Subject: [PATCH] [DoodStream] Support more TLDs * also fix title extraction --- youtube_dl/extractor/doodstream.py | 35 +++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/doodstream.py b/youtube_dl/extractor/doodstream.py index 70bf4e512..94411ebb0 100644 --- a/youtube_dl/extractor/doodstream.py +++ b/youtube_dl/extractor/doodstream.py @@ -21,7 +21,7 @@ from .common import InfoExtractor class DoodStreamIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?dood\.(?:to|watch)/[ed]/(?P[a-z0-9]+)' + _VALID_URL = r'https?://(?:www\.)?dood\.(?:to|watch|so|la|pm|sh|ws|one)/[ed]/(?P[a-z0-9]+)' _TESTS = [{ 'url': 'http://dood.to/e/5s1wmbdacezb', 'md5': '4568b83b31e13242b3f1ff96c55f0595', @@ -61,11 +61,24 @@ class DoodStreamIE(InfoExtractor): 'info_dict': { 'id': 'is34uy8wvaet', 'ext': 'mp4', - 'title': 'Akhanda (2021) Telugu DVDScr MP3 700MB - DoodStream', + 'title': 'Akhanda (2021) Telugu DVDScr MP3 700MB', 'upload_date': '20211202', + 'thumbnail': r're:https?://img\.doodcdn\.com?/[\w/]+\.jpg', 'filesize_approx': int, 'duration': 9886, } + }, { + 'url': 'https://dood.so/d/wlihoael8uog', + 'md5': '2c14444c89788cc309738c1560abe278', + 'info_dict': { + 'id': 'wlihoael8uog', + 'ext': 'mp4', + 'title': 'VID 20220319 161659', + 'thumbnail': r're:https?://img\.doodcdn\.com?/splash/rmpnhb8ckkk79cge\.jpg', + 'upload_date': '20220319', + 'filesize_approx': int, + 'duration': 12.0, + } }] def _real_extract(self, url): @@ -76,11 +89,12 @@ class DoodStreamIE(InfoExtractor): } webpage = self._download_webpage(url, video_id, headers=headers) - title = self._html_search_meta(('og:title', 'twitter:title'), webpage, default=None) - if not title: - title = self._html_search_regex(r']*>([^<]+?)(?:\|\s+DoodStream\s*)?]*>([^<]+?)(?:[|-]\s+DoodStream\s*)?