Merge pull request #331 from aviperes/facebook_videos_new_ui_bug_fix

fix title, subscription, comments, live
This commit is contained in:
aviperetz34 2020-06-07 15:43:26 +03:00 committed by GitHub
commit ea45fd1032
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -507,9 +507,10 @@ class FacebookIE(InfoExtractor):
def get_from_new_ui(self, webpage, tahoe_data, url): def get_from_new_ui(self, webpage, tahoe_data, url):
video_title = self._search_regex(r'"headline":"(.+?")', webpage, 'title') video_title = self._search_regex(r'"headline":"(.+?")', webpage, 'title', fatal=False)
comments_count = parse_count(self._search_regex(r'"commentCount":(.+?,)', webpage, 'comments_count')) if not video_title:
subtitles = self._search_regex(r'"about":"(.+?")', webpage, 'subtitles') video_title = self._search_regex(r'"pageTitle">(.+?)<', webpage, 'title')
comments_count = parse_count(self._search_regex(r'"commentCount":(.+?,)', webpage, 'comments_count', fatal=False))
likes = parse_count(self._extract_likes(webpage, tahoe_data)) likes = parse_count(self._extract_likes(webpage, tahoe_data))
timestamp = self._search_regex(r'"datePublished":"(.+?)"', webpage, 'timestamp') timestamp = self._search_regex(r'"datePublished":"(.+?)"', webpage, 'timestamp')
@ -719,10 +720,10 @@ class FacebookIE(InfoExtractor):
live_status = 'not_live' live_status = 'not_live'
if is_broadcast: if is_broadcast:
live_status = 'completed' live_status = 'completed'
if is_live_stream: if is_live_stream:
live_status = 'live' live_status = 'live'
if is_scheduled: if is_scheduled:
live_status = 'upcoming' live_status = 'upcoming'
is_live = live_status == 'live' is_live = live_status == 'live'