1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-15 20:13:01 +08:00

fix unicode characters (#357)

Co-authored-by: bhodaya <bhodaya@videocites.com>
This commit is contained in:
hodayabu 2020-09-10 13:05:10 +03:00 committed by GitHub
parent 001c25e1a5
commit 2229c2b3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -35,6 +35,13 @@ class facebookMetaData(unittest.TestCase):
self.assertTrue(info.get('uploader_handle'), 0)
self.assertGreater(len(info.get('title')), 0)
def test_new_ui(self):
params = {}
url = "https://www.facebook.com/115232383642471/videos/444314619837387"
ydl = youtube_dl.YoutubeDL(params)
info = ydl.extract_info(url, download=False)
self.assertGreater(len(info.get('title')), 0)
def test_metadata_fetch_with_log_in(self):
url = "https://www.facebook.com/oristandup/videos/675360549895283"

View File

@ -781,6 +781,7 @@ class FacebookIE(InfoExtractor):
def _resolve_new_ui_title(self, webpage, tahoe_data, video_id):
video_title = self._search_regex(r'"headline":"(.+?")', webpage, 'title', fatal=False)
video_title = video_title.decode('unicode_escape')
if not video_title:
video_title = self._search_regex(r'"pageTitle">(.+?)<', webpage, 'title', fatal=False)
if not video_title: