From 2d12783b9c7dd7564062ac737ef09de5fff1c7fb Mon Sep 17 00:00:00 2001 From: JChris246 Date: Sun, 16 Mar 2025 01:45:05 -0400 Subject: [PATCH] fix: differentiate between direct urls and m3u8 --- yt_dlp/extractor/fc2.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/yt_dlp/extractor/fc2.py b/yt_dlp/extractor/fc2.py index f7b883155c..671a2cee51 100644 --- a/yt_dlp/extractor/fc2.py +++ b/yt_dlp/extractor/fc2.py @@ -22,8 +22,23 @@ class FC2IE(InfoExtractor): 'md5': 'a6ebe8ebe0396518689d963774a54eb7', 'info_dict': { 'id': '20121103kUan1KHs', - 'ext': 'flv', 'title': 'Boxing again with Puff', + 'ext': 'mp4', + 'thumbnail': 're:^https?://.+.jpg?(?:\\d+)?' + }, + 'file_minsize': 633, + 'params': { + 'skip_download': True + }, + }, { + 'url': 'https://video.fc2.com/content/20121129xMeT3Czt', + 'md5': '19109bbee429d5b3765986505d44a012', + 'info_dict': { + 'id': '20121129xMeT3Czt', + 'title': 'Rotfux', + 'ext': 'mp4', + 'thumbnail': 're:^https?://.+.jpg?(?:\\d+)?', + 'description': 'Rotfux', }, }, { 'url': 'http://video.fc2.com/en/content/20150125cEva0hDn/', @@ -99,12 +114,18 @@ def _real_extract(self, url): raise ExtractorError('Unable to extract video URL') vid_url = urljoin('https://video.fc2.com/', vid_url) + if vidplaylist.get('type') == '1': + formats = self._extract_m3u8_formats(vid_url, video_id, 'mp4',) + else: + formats = [{ + 'url': vid_url, + 'ext': 'mp4', + }] + return { 'id': video_id, 'title': title, - 'url': vid_url, - 'ext': 'mp4', - 'protocol': 'm3u8_native', + 'formats': formats, 'description': description, 'thumbnail': thumbnail, }