Merge branch 'fix-facebook-date' into fix.25.12.2018

This commit is contained in:
Avi Peretz 2019-01-14 16:08:38 +02:00
commit e0f10e6796

View File

@ -59,7 +59,6 @@ class FacebookIE(InfoExtractor):
_VIDEO_PAGE_TEMPLATE = 'https://www.facebook.com/video/video.php?v=%s' _VIDEO_PAGE_TEMPLATE = 'https://www.facebook.com/video/video.php?v=%s'
_VIDEO_PAGE_TAHOE_TEMPLATE = 'https://www.facebook.com/video/tahoe/async/%s/?chain=true&isvideo=true&payloadtype=%s' _VIDEO_PAGE_TAHOE_TEMPLATE = 'https://www.facebook.com/video/tahoe/async/%s/?chain=true&isvideo=true&payloadtype=%s'
_TESTS = [{ _TESTS = [{
'url': 'https://www.facebook.com/video.php?v=637842556329505&fref=nf', 'url': 'https://www.facebook.com/video.php?v=637842556329505&fref=nf',
'md5': '6a40d33c0eccbb1af76cf0485a052659', 'md5': '6a40d33c0eccbb1af76cf0485a052659',
@ -358,7 +357,8 @@ class FacebookIE(InfoExtractor):
# Video info not in first request, do a secondary request using # Video info not in first request, do a secondary request using
# tahoe player specific URL # tahoe player specific URL
tahoe_request_data = urlencode_postdata({ tahoe_request_data = urlencode_postdata(
{
'__a': 1, '__a': 1,
'__pc': self._search_regex( '__pc': self._search_regex(
r'pkg_cohort["\']\s*:\s*["\'](.+?)["\']', webpage, r'pkg_cohort["\']\s*:\s*["\'](.+?)["\']', webpage,
@ -449,6 +449,12 @@ class FacebookIE(InfoExtractor):
r'data-utime=\\\"(\d+)\\\"', tahoe_secondary_data, r'data-utime=\\\"(\d+)\\\"', tahoe_secondary_data,
'timestamp', default=None)) 'timestamp', default=None))
uploader_id = self._search_regex(
r'ownerid:"([\d]+)', webpage,
'uploader_id', default=None) or self._search_regex(
r'\"ownerid\":"(\d+)"', tahoe_secondary_data,
'uploader_id', default=None)
thumbnail = self._og_search_thumbnail(webpage) thumbnail = self._og_search_thumbnail(webpage)
view_count = parse_count(self._search_regex( view_count = parse_count(self._search_regex(
@ -463,6 +469,7 @@ class FacebookIE(InfoExtractor):
'timestamp': timestamp, 'timestamp': timestamp,
'thumbnail': thumbnail, 'thumbnail': thumbnail,
'view_count': view_count, 'view_count': view_count,
'uploader_id': uploader_id
} }
return webpage, info_dict return webpage, info_dict