mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-23 11:31:29 +01:00
add regex for video webpage url
This commit is contained in:
parent
4070c00ba7
commit
151b383fe1
|
@ -13,35 +13,28 @@ class CableCastTVIE(InfoExtractor):
|
|||
'ext': 'mp4',
|
||||
'title': 'Village Board Meeting 4/24/24',
|
||||
},
|
||||
}, {
|
||||
'url': 'https://fyptt.to/10382/beautiful-livestream-tits-and-nipples-slip-from-girls-who-loves-talking-with-their-viewers/',
|
||||
'only_matching': True,
|
||||
}, {
|
||||
'url': 'https://fyptt.to/120/small-tits-fit-blonde-dancing-naked-at-the-front-door-on-tiktok',
|
||||
'only_matching': True,
|
||||
}, {
|
||||
'url': 'https://fkbae.to/18',
|
||||
'only_matching': True,
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
with open('output.txt', 'w', encoding='utf-8') as file:
|
||||
file.write(webpage)
|
||||
|
||||
|
||||
url_video_webpage = self._html_search_regex(r'<iframe[^>]*class=\"trms-player\"[^>]*src=\"([^\"]+)\"', webpage, 'url_video_webpage')
|
||||
webpage_video = self._download_webpage(url_video_webpage, video_id)
|
||||
|
||||
video_url = self._html_search_regex(r'"([^\"]*\.m3u8)"', webpage_video, 'video URL')
|
||||
print(video_url)
|
||||
|
||||
formats = []
|
||||
format_url = self._html_search_regex(r'"embedURL":"([^"]+)"', webpage, 'video URL')
|
||||
format_url = re.sub(r'\\', '', format_url)
|
||||
formats.extend(self._extract_m3u8_formats(video_url, video_id, ext='mp4', m3u8_id='hls'))
|
||||
print(formats)
|
||||
#format_url = re.sub(r'\\', '', format_url)
|
||||
|
||||
webpage_video = self._download_webpage(format_url, video_id)
|
||||
|
||||
match = re.search(r'(https:\/\/[^"]+\.mp4)', webpage_video)
|
||||
format_url = match.group(1)
|
||||
formats.append({
|
||||
'url': format_url,
|
||||
'format_id': 'default',
|
||||
})
|
||||
|
||||
title = self._html_search_regex(r'<span class="fl-heading-text">(.+?)</span>', webpage, 'title')
|
||||
title = self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title')
|
||||
|
||||
# base_url = re.search(r'^(https?://[a-zA-Z0-9_-]+\.to)', url).group(1)
|
||||
# http_headers = {'Referer': base_url}
|
||||
|
|
Loading…
Reference in New Issue
Block a user