From 73b672a979a9161a8ebbc52c9971c35ca1f5c1c3 Mon Sep 17 00:00:00 2001 From: EGA-SUPREMO Date: Mon, 29 Apr 2024 14:15:24 -0400 Subject: [PATCH] add regex for title --- yt_dlp/extractor/fyptt.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/yt_dlp/extractor/fyptt.py b/yt_dlp/extractor/fyptt.py index c77d0c423..42fcf4e9e 100644 --- a/yt_dlp/extractor/fyptt.py +++ b/yt_dlp/extractor/fyptt.py @@ -1,8 +1,7 @@ from .common import InfoExtractor - class FYPTTIE(InfoExtractor): - _VALID_URL = r'https?://(?:stream\.|)fyptt\.to/(?P[0-9a-zA-Z]+)(?:\.|/)' + _VALID_URL = r'https?://(?:stream\.|)fyptt\.to/(?P[0-9a-zA-Z]+)(?:|/)' _TESTS = [{ 'url': 'https://fyptt.to/203/gorgeous-naughty-blonde-with-beautiful-curves-shows-her-naked-boobies-on-nsfw-tiktok/', 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', @@ -32,16 +31,31 @@ class FYPTTIE(InfoExtractor): }] def _real_extract(self, url): - #video_id = self._match_id(url) - #webpage = self._download_webpage(url, video_id) + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + formats = [] + +# format_url = self._html_search_regex(r'(.+?)', webpage, 'title') + #format_url = self._html_search_regex(r'', webpage, 'video URL') + print("format_url") + format_url = self._html_search_regex(r'', webpage, 'format_url') + print(format_url) + formats.append({ + 'url': format_url, + 'format_id': 'default', + }) + + title = self._html_search_regex(r'(.+?)', webpage, 'title') + +# + - # TODO more code goes here, for example ... - title = self._html_search_regex(r'

(.+?)

', webpage, 'title') return { 'id': video_id, 'title': title, 'description': self._og_search_description(webpage), - 'uploader': self._search_regex(r']+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False), - # TODO more properties (see yt_dlp/extractor/common.py) + 'age_limit': 18, + 'formats': formats, } \ No newline at end of file