aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/facebook.py
diff options
context:
space:
mode:
authorbashonly <88596187+bashonly@users.noreply.github.com>2022-08-14 20:03:24 +0000
committerGitHub <noreply@github.com>2022-08-15 01:33:24 +0530
commit63be30e3e06a11d1243032ef7f444e4e276470d4 (patch)
tree79d1239a3341eed13201c8af2924c7a1cdd0498e /yt_dlp/extractor/facebook.py
parent43cf982ac353c6e257c4d8fadb02c20491a007fb (diff)
downloadhypervideo-pre-63be30e3e06a11d1243032ef7f444e4e276470d4.tar.lz
hypervideo-pre-63be30e3e06a11d1243032ef7f444e4e276470d4.tar.xz
hypervideo-pre-63be30e3e06a11d1243032ef7f444e4e276470d4.zip
[extractor/facebook] Add reel support (#4660)
Closes #4039 Authored by: bashonly
Diffstat (limited to 'yt_dlp/extractor/facebook.py')
-rw-r--r--yt_dlp/extractor/facebook.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.py
index d434b359a..35acbc643 100644
--- a/yt_dlp/extractor/facebook.py
+++ b/yt_dlp/extractor/facebook.py
@@ -772,3 +772,30 @@ class FacebookRedirectURLIE(InfoExtractor):
if not redirect_url:
raise ExtractorError('Invalid facebook redirect URL', expected=True)
return self.url_result(redirect_url)
+
+
+class FacebookReelIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:[\w-]+\.)?facebook\.com/reel/(?P<id>\d+)'
+ IE_NAME = 'facebook:reel'
+
+ _TESTS = [{
+ 'url': 'https://www.facebook.com/reel/1195289147628387',
+ 'md5': 'c4ff9a7182ff9ff7d6f7a83603bae831',
+ 'info_dict': {
+ 'id': '1195289147628387',
+ 'ext': 'mp4',
+ 'title': 'md5:9f5b142921b2dc57004fa13f76005f87',
+ 'description': 'md5:24ea7ef062215d295bdde64e778f5474',
+ 'uploader': 'Beast Camp Training',
+ 'uploader_id': '1738535909799870',
+ 'duration': 9.536,
+ 'thumbnail': r're:^https?://.*',
+ 'upload_date': '20211121',
+ 'timestamp': 1637502604,
+ }
+ }]
+
+ def _real_extract(self, url):
+ video_id = self._match_id(url)
+ return self.url_result(
+ f'https://m.facebook.com/watch/?v={video_id}&_rdr', FacebookIE, video_id)