1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-03-09 22:57:16 +08:00

fix unicode characters (#354)

* fix unicode characters

* fix unicode characters

Co-authored-by: bhodaya <bhodaya@videocites.com>
This commit is contained in:
hodayabu 2020-08-19 14:49:56 +03:00 committed by GitHub
parent ea1996d492
commit f90e0c8de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -28,11 +28,13 @@ class facebookMetaData(unittest.TestCase):
def test_meta_data(self):
params = {}
url = "https://www.facebook.com/parapsychological.centr/videos/177407933624543/"
url = "https://www.facebook.com/watch?v=925616657920281"
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)
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

@ -693,6 +693,9 @@ class FacebookIE(InfoExtractor):
video_title = self._og_search_title(webpage, default=None)
if not self._valid_video_title(video_title):
video_title = self._resolve_description(webpage, tahoe_data)
if not self._valid_video_title(video_title):
video_title = self._html_search_regex(r'"videoTitle":"(.+?")', tahoe_data.secondary, 'title from secondary', default=None)
video_title = video_title.decode('unicode_escape')
if not self._valid_video_title(video_title):
values = re.findall(r'videoTitle"\s*:\s*"(.*?)"', tahoe_data.secondary)
if values: