yt-dlp/yt_dlp/extractor/fyptt.py

53 lines
1.8 KiB
Python
Raw Normal View History

2024-04-22 15:04:45 +00:00
from .common import InfoExtractor
2024-04-30 12:17:27 +00:00
import re
2024-04-22 15:04:45 +00:00
2024-05-03 14:21:47 +00:00
2024-04-22 15:04:45 +00:00
class FYPTTIE(InfoExtractor):
2024-04-29 18:15:24 +00:00
_VALID_URL = r'https?://(?:stream\.|)fyptt\.to/(?P<id>[0-9a-zA-Z]+)(?:|/)'
2024-04-22 15:04:45 +00:00
_TESTS = [{
2024-04-22 15:43:07 +00:00
'url': 'https://fyptt.to/203/gorgeous-naughty-blonde-with-beautiful-curves-shows-her-naked-boobies-on-nsfw-tiktok/',
2024-05-03 13:24:54 +00:00
'md5': 'fc12bce4a9c1335f153500c8fea6e1a8',
2024-04-22 15:04:45 +00:00
'info_dict': {
2024-04-22 15:43:07 +00:00
'id': '203',
2024-04-22 15:04:45 +00:00
'ext': 'mp4',
2024-05-03 13:24:54 +00:00
'title': 'Gorgeous, naughty blonde with beautiful curves shows her naked boobies on NSFW TikTok',
'age_limit': 18
2024-04-22 15:43:07 +00:00
},
}, {
'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,
2024-04-22 15:04:45 +00:00
}]
2024-05-03 13:24:54 +00:00
2024-04-22 15:04:45 +00:00
def _real_extract(self, url):
2024-04-29 18:15:24 +00:00
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
2024-05-03 14:11:08 +00:00
2024-04-29 18:15:24 +00:00
formats = []
2024-04-30 12:17:27 +00:00
format_url = self._html_search_regex(r'"embedURL":"([^"]+)"', webpage, 'video URL')
format_url = re.sub(r'\\', '', format_url)
2024-05-03 14:21:47 +00:00
2024-04-30 12:17:27 +00:00
webpage_video = self._download_webpage(format_url, video_id)
2024-05-03 14:11:08 +00:00
match = re.search(r'(https:\/\/[^"]+\.mp4)', webpage_video)
2024-04-30 12:17:27 +00:00
format_url = match.group(1)
2024-04-29 18:15:24 +00:00
formats.append({
'url': format_url,
'format_id': 'default',
})
title = self._html_search_regex(r'<span class="fl-heading-text">(.+?)</span>', webpage, 'title')
2024-05-03 13:24:54 +00:00
2024-05-03 14:21:47 +00:00
http_headers = {'Referer': 'https://fyptt.to/'}
2024-04-29 18:15:24 +00:00
2024-04-22 15:04:45 +00:00
return {
'id': video_id,
'title': title,
2024-04-29 18:15:24 +00:00
'formats': formats,
2024-05-03 13:24:54 +00:00
'age_limit': 18,
2024-05-03 12:01:49 +00:00
'http_headers': http_headers
2024-05-03 13:24:54 +00:00
}