[facebook] improve 'date' extraction (#7151)

use 'created_time' as alternative when 'publish_time' isn't available
This commit is contained in:
Mike Fährmann
2025-03-10 17:35:32 +01:00
parent 04464b6cf0
commit ce01835995
2 changed files with 13 additions and 3 deletions

View File

@@ -99,9 +99,10 @@ class FacebookExtractor(Extractor):
'"message":{"delight_ranges"',
'"},"message_preferred_body"'
).rsplit('],"text":"', 1)[-1]),
"date": text.parse_timestamp(text.extr(
photo_page, '\\"publish_time\\":', ','
)),
"date": text.parse_timestamp(
text.extr(photo_page, '\\"publish_time\\":', ',') or
text.extr(photo_page, '"created_time":', ',')
),
"url": FacebookExtractor.decode_all(text.extr(
photo_page, ',"image":{"uri":"', '","'
)),