1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-23 00:54:31 +01:00

Styling changes

This commit is contained in:
sxvghd 2020-08-17 17:07:22 +02:00
parent b50f352f59
commit c00c1575b6

View File

@ -42,17 +42,20 @@ class DoodStreamIE(InfoExtractor):
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)
title = self._og_search_title(webpage) or self._html_search_meta( title = self._html_search_meta(['og:title', 'twitter:title'],
'twitter:title', webpage, default=None) webpage, default=None)
thumb = self._og_search_thumbnail(webpage) or self._html_search_meta( thumb = self._html_search_meta(['og:image', 'twitter:image'],
'twitter:image', webpage, default=None) webpage, default=None)
token = self._html_search_regex(r'[?&]token=([a-z0-9]+)[&\']', webpage, 'token') token = self._html_search_regex(r'[?&]token=([a-z0-9]+)[&\']', webpage, 'token')
description = self._og_search_description(webpage) or self._html_search_meta( description = self._html_search_meta(
'description', webpage, default=None) or self._html_search_meta( ['og:description', 'description', 'twitter:description'],
'twitter:description', webpage, default=None) webpage, default=None)
auth_url = 'https://dood.to' + self._html_search_regex( auth_url = 'https://dood.to' + self._html_search_regex(
r'(/pass_md5.*?)\'', webpage, 'pass_md5') r'(/pass_md5.*?)\'', webpage, 'pass_md5')
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/66.0', 'referer': url} headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/66.0',
'referer': url
}
webpage = self._download_webpage(auth_url, video_id, headers=headers) webpage = self._download_webpage(auth_url, video_id, headers=headers)
final_url = webpage + ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(10)]) + "?token=" + token + "&expiry=" + str(int(time.time() * 1000)) final_url = webpage + ''.join([random.choice(string.ascii_letters + string.digits) for _ in range(10)]) + "?token=" + token + "&expiry=" + str(int(time.time() * 1000))