[generic] hook up the doodstream extractor to look for embeds

pull/100/head
sxvghd 5 years ago
parent 7fb5f2f29d
commit a2e9db5e60

@ -4,6 +4,7 @@ from __future__ import unicode_literals
import string import string
import random import random
import time import time
import re
from .common import InfoExtractor from .common import InfoExtractor
@ -32,6 +33,12 @@ class DoodStreamIE(InfoExtractor):
} }
}] }]
@staticmethod
def _extract_urls(webpage):
return re.findall(
r'<iframe[^>]+?src=["\'](?P<url>(?:https?://)?dood\.(?:watch|to)/e/.+?)["\']',
webpage)
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)

@ -119,6 +119,7 @@ from .expressen import ExpressenIE
from .zype import ZypeIE from .zype import ZypeIE
from .odnoklassniki import OdnoklassnikiIE from .odnoklassniki import OdnoklassnikiIE
from .kinja import KinjaEmbedIE from .kinja import KinjaEmbedIE
from .doodstream import DoodStreamIE
class GenericIE(InfoExtractor): class GenericIE(InfoExtractor):
@ -3191,6 +3192,11 @@ class GenericIE(InfoExtractor):
return self.playlist_from_matches( return self.playlist_from_matches(
foxnews_urls, video_id, video_title, ie=FoxNewsIE.ie_key()) 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( sharevideos_urls = [sharevideos_mobj.group('url') for sharevideos_mobj in re.finditer(
r'<iframe[^>]+?\bsrc\s*=\s*(["\'])(?P<url>(?:https?:)?//embed\.share-videos\.se/auto/embed/\d+\?.*?\buid=\d+.*?)\1', r'<iframe[^>]+?\bsrc\s*=\s*(["\'])(?P<url>(?:https?:)?//embed\.share-videos\.se/auto/embed/\d+\?.*?\buid=\d+.*?)\1',
webpage)] webpage)]

Loading…
Cancel
Save