]>
jfr.im git - yt-dlp.git/blob - youtube_dlc/extractor/doodstream.py
2 from __future__
import unicode_literals
8 from .common
import InfoExtractor
11 class DoodStreamIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?dood\.(?:to|watch)/[ed]/(?P<id>[a-z0-9]+)'
14 'url': 'http://dood.to/e/5s1wmbdacezb',
15 'md5': '4568b83b31e13242b3f1ff96c55f0595',
19 'title': 'Kat Wonders - Monthly May 2020',
20 'description': 'Kat Wonders - Monthly May 2020 | DoodStream.com',
21 'thumbnail': 'https://img.doodcdn.com/snaps/flyus84qgl2fsk4g.jpg',
24 'url': 'https://dood.to/d/jzrxn12t2s7n',
25 'md5': '3207e199426eca7c2aa23c2872e6728a',
29 'title': 'Stacy Cruz Cute ALLWAYSWELL',
30 'description': 'Stacy Cruz Cute ALLWAYSWELL | DoodStream.com',
31 'thumbnail': 'https://img.doodcdn.com/snaps/8edqd5nppkac3x8u.jpg',
35 def _real_extract(self
, url
):
36 video_id
= self
._match
_id
(url
)
37 webpage
= self
._download
_webpage
(url
, video_id
)
40 url
= "https://dood.to" + self
._html
_search
_regex
(
41 r
'<iframe src="(/e/[a-z0-9]+)"', webpage
, 'embed')
42 video_id
= self
._match
_id
(url
)
43 webpage
= self
._download
_webpage
(url
, video_id
)
45 title
= self
._html
_search
_meta
(['og:title', 'twitter:title'],
46 webpage
, default
=None)
47 thumb
= self
._html
_search
_meta
(['og:image', 'twitter:image'],
48 webpage
, default
=None)
49 token
= self
._html
_search
_regex
(r
'[?&]token=([a-z0-9]+)[&\']', webpage, 'token
')
50 description = self._html_search_meta(
51 ['og
:description
', 'description
', 'twitter
:description
'],
52 webpage, default=None)
53 auth_url = 'https
://dood
.to
' + self._html_search_regex(
54 r'(/pass_md5
.*?
)\'', webpage, 'pass_md5
')
56 'User
-Agent
': 'Mozilla
/5.0 (Windows NT
6.1; WOW64
; rv
:53.0) Gecko
/20100101 Firefox
/66.0',
60 webpage = self._download_webpage(auth_url, video_id, headers=headers)
61 final_url = webpage + ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(10)]) + "?token=" + token + "&expiry=" + str(int(time.time() * 1000))
67 'http_headers
': headers,
69 'description
': description,