# coding: utf-8 from __future__ import unicode_literals import string import random import time import re from .common import InfoExtractor class DoodStreamIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?dood\.(?:to|watch|so)/[ed]/(?P[a-z0-9]+)' _TESTS = [{ 'url': 'https://dood.to/d/wpyp2mgwi2kb', 'md5': '2aaf633bcd5fefb64b27344f55022bf9', 'info_dict': { 'id': 'wpyp2mgwi2kb', 'ext': 'mp4', 'title': 'Big Buck Bunny Trailer', 'thumbnail': r're:^https?://.*\.jpg$', }, }] @staticmethod def _extract_urls(webpage): return re.findall( r']+?src=["\'](?P(?:https?://)?dood\.(?:watch|to|so)/e/.+?)["\']', webpage) def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) if '/d/' in url: url = "https://dood.to" + self._html_search_regex( r'