Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions youtube_dlc/extractor/doodstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import string
import random
import time
import re

from .common import InfoExtractor

Expand Down Expand Up @@ -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):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
Expand Down
6 changes: 6 additions & 0 deletions youtube_dlc/extractor/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
from .zype import ZypeIE
from .odnoklassniki import OdnoklassnikiIE
from .kinja import KinjaEmbedIE
from .doodstream import DoodStreamIE
from .rcs import RCSEmbedsIE
from .bitchute import BitChuteIE

Expand Down Expand Up @@ -3192,6 +3193,11 @@ def _real_extract(self, url):
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'<iframe[^>]+?\bsrc\s*=\s*(["\'])(?P<url>(?:https?:)?//embed\.share-videos\.se/auto/embed/\d+\?.*?\buid=\d+.*?)\1',
webpage)]
Expand Down