From 832b943193a44c60cbf103e18600526791d07663 Mon Sep 17 00:00:00 2001 From: bhodaya Date: Sun, 16 Aug 2020 16:49:51 +0300 Subject: [PATCH] fix uploader handle fb --- test/ci/test_facebook.py | 1 + youtube_dl/extractor/facebook.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ci/test_facebook.py b/test/ci/test_facebook.py index b53969c96..1cc564518 100644 --- a/test/ci/test_facebook.py +++ b/test/ci/test_facebook.py @@ -32,6 +32,7 @@ class facebookMetaData(unittest.TestCase): ydl = youtube_dl.YoutubeDL(params) info = ydl.extract_info(url, download=False) self.assertGreater(info.get('comment_count'), 0) + self.assertTrue(info.get('uploader_handle'), 0) def test_metadata_fetch_with_log_in(self): url = "https://www.facebook.com/oristandup/videos/675360549895283" diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py index 4088f6f84..1abcf8d62 100644 --- a/youtube_dl/extractor/facebook.py +++ b/youtube_dl/extractor/facebook.py @@ -561,7 +561,7 @@ class FacebookIE(InfoExtractor): uploader_handle = self._search_regex(r'"video_path":"\\\/([^\/]+)\\\/', tahoe_data.primary, 'uploader_handle', fatal=False) if uploader_handle == uploader_id: - uploader_handle = self._search_regex(r'href=\\"https:\\\/\\\/www.facebook.com\\\/(.+?)\\\/\\', tahoe_data.secondary, + uploader_handle = self._search_regex(r'href=\\"https:\\\/\\\/www.facebook.com\\\/(.+?)\\\/', tahoe_data.secondary, 'uploader_handle', fatal=False)