From bab753c54740c846dab390f3378da2470e255598 Mon Sep 17 00:00:00 2001 From: EGA-SUPREMO Date: Mon, 22 Apr 2024 11:04:45 -0400 Subject: [PATCH] add fyptt extrator empty file --- yt_dlp/extractor/_extractors.py | 1 + yt_dlp/extractor/fyptt.py | 41 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 yt_dlp/extractor/fyptt.py diff --git a/yt_dlp/extractor/_extractors.py b/yt_dlp/extractor/_extractors.py index 42034275b..9ab41bde1 100644 --- a/yt_dlp/extractor/_extractors.py +++ b/yt_dlp/extractor/_extractors.py @@ -665,6 +665,7 @@ from .funimation import ( from .funk import FunkIE from .funker530 import Funker530IE from .fuyintv import FuyinTVIE +from .fyptt import FYPTTIE from .gab import ( GabTVIE, GabIE, diff --git a/yt_dlp/extractor/fyptt.py b/yt_dlp/extractor/fyptt.py new file mode 100644 index 000000000..7db877aa8 --- /dev/null +++ b/yt_dlp/extractor/fyptt.py @@ -0,0 +1,41 @@ +from .common import InfoExtractor + + +class FYPTTIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?yourextractor\.com/watch/(?P[0-9]+)' + _TESTS = [{ + 'url': 'https://yourextractor.com/watch/42', + 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', + 'info_dict': { + # For videos, only the 'id' and 'ext' fields are required to RUN the test: + 'id': '42', + 'ext': 'mp4', + # Then if the test run fails, it will output the missing/incorrect fields. + # Properties can be added as: + # * A value, e.g. + # 'title': 'Video title goes here', + # * MD5 checksum; start the string with 'md5:', e.g. + # 'description': 'md5:098f6bcd4621d373cade4e832627b4f6', + # * A regular expression; start the string with 're:', e.g. + # 'thumbnail': r're:^https?://.*\.jpg$', + # * A count of elements in a list; start the string with 'count:', e.g. + # 'tags': 'count:10', + # * Any Python type, e.g. + # 'view_count': int, + } + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + # 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) + } \ No newline at end of file