From a2e9db5e604293a33c3ada97d3c04d664d23a7b2 Mon Sep 17 00:00:00 2001 From: sxvghd Date: Sun, 1 Nov 2020 19:39:56 +0100 Subject: [PATCH] [generic] hook up the doodstream extractor to look for embeds --- youtube_dlc/extractor/doodstream.py | 7 +++++++ youtube_dlc/extractor/generic.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/youtube_dlc/extractor/doodstream.py b/youtube_dlc/extractor/doodstream.py index 2c9ea6898..25c59f6ec 100644 --- a/youtube_dlc/extractor/doodstream.py +++ b/youtube_dlc/extractor/doodstream.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import string import random import time +import re from .common import InfoExtractor @@ -32,6 +33,12 @@ class DoodStreamIE(InfoExtractor): } }] + @staticmethod + def _extract_urls(webpage): + return re.findall( + r']+?src=["\'](?P(?:https?://)?dood\.(?:watch|to)/e/.+?)["\']', + webpage) + def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) diff --git a/youtube_dlc/extractor/generic.py b/youtube_dlc/extractor/generic.py index aba06b328..7824e5040 100644 --- a/youtube_dlc/extractor/generic.py +++ b/youtube_dlc/extractor/generic.py @@ -119,6 +119,7 @@ from .expressen import ExpressenIE from .zype import ZypeIE from .odnoklassniki import OdnoklassnikiIE from .kinja import KinjaEmbedIE +from .doodstream import DoodStreamIE class GenericIE(InfoExtractor): @@ -3191,6 +3192,11 @@ class GenericIE(InfoExtractor): return self.playlist_from_matches( foxnews_urls, video_id, video_title, ie=FoxNewsIE.ie_key()) + doodstream_urls = DoodStreamIE._extract_urls(webpage) + if doodstream_urls: + return self.playlist_from_matches( + doodstream_urls, video_id, video_title, ie=DoodStreamIE.ie_key()) + sharevideos_urls = [sharevideos_mobj.group('url') for sharevideos_mobj in re.finditer( r']+?\bsrc\s*=\s*(["\'])(?P(?:https?:)?//embed\.share-videos\.se/auto/embed/\d+\?.*?\buid=\d+.*?)\1', webpage)]