2 from __future__
import unicode_literals
7 from .common
import InfoExtractor
9 compat_etree_fromstring
,
11 compat_urllib_parse_unquote
,
12 compat_urllib_parse_unquote_plus
,
34 class FacebookIE(InfoExtractor
):
38 (?:[\w-]+\.)?(?:facebook\.com|facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd\.onion)/
48 )\?(?:.*?)(?:v|video_id|story_fbid)=|
49 [^/]+/videos/(?:[^/]+/)?|
51 groups/[^/]+/permalink/|
58 _LOGIN_URL
= 'https://www.facebook.com/login.php?next=http%3A%2F%2Ffacebook.com%2Fhome.php&login_attempt=1'
59 _CHECKPOINT_URL
= 'https://www.facebook.com/checkpoint/?next=http%3A%2F%2Ffacebook.com%2Fhome.php&_fb_noscript=1'
60 _NETRC_MACHINE
= 'facebook'
63 _VIDEO_PAGE_TEMPLATE
= 'https://www.facebook.com/video/video.php?v=%s'
64 _VIDEO_PAGE_TAHOE_TEMPLATE
= 'https://www.facebook.com/video/tahoe/async/%s/?chain=true&isvideo=true&payloadtype=primary'
67 'url': 'https://www.facebook.com/video.php?v=637842556329505&fref=nf',
68 'md5': '6a40d33c0eccbb1af76cf0485a052659',
70 'id': '637842556329505',
72 'title': 're:Did you know Kei Nishikori is the first Asian man to ever reach a Grand Slam',
73 'uploader': 'Tennis on Facebook',
74 'upload_date': '20140908',
75 'timestamp': 1410199200,
77 'skip': 'Requires logging in',
80 'url': 'https://www.facebook.com/video.php?v=274175099429670',
82 'id': '274175099429670',
84 'title': 'Asif Nawab Butt',
85 'description': 'Asif Nawab Butt',
86 'uploader': 'Asif Nawab Butt',
87 'upload_date': '20140506',
88 'timestamp': 1399398998,
89 'thumbnail': r
're:^https?://.*',
91 'expected_warnings': [
95 'note': 'Video with DASH manifest',
96 'url': 'https://www.facebook.com/video.php?v=957955867617029',
97 'md5': 'b2c28d528273b323abe5c6ab59f0f030',
99 'id': '957955867617029',
101 'title': 'When you post epic content on instagram.com/433 8 million followers, this is ...',
102 'uploader': 'Demy de Zeeuw',
103 'upload_date': '20160110',
104 'timestamp': 1452431627,
106 'skip': 'Requires logging in',
108 'url': 'https://www.facebook.com/maxlayn/posts/10153807558977570',
109 'md5': '037b1fa7f3c2d02b7a0d7bc16031ecc6',
111 'id': '544765982287235',
113 'title': '"What are you doing running in the snow?"',
114 'uploader': 'FailArmy',
116 'skip': 'Video gone',
118 'url': 'https://m.facebook.com/story.php?story_fbid=1035862816472149&id=116132035111903',
119 'md5': '1deb90b6ac27f7efcf6d747c8a27f5e3',
121 'id': '1035862816472149',
123 'title': 'What the Flock Is Going On In New Zealand Credit: ViralHog',
124 'uploader': 'S. Saint',
126 'skip': 'Video gone',
128 'note': 'swf params escaped',
129 'url': 'https://www.facebook.com/barackobama/posts/10153664894881749',
130 'md5': '97ba073838964d12c70566e0085c2b91',
132 'id': '10153664894881749',
134 'title': 'Average time to confirm recent Supreme Court nominees: 67 days Longest it\'s t...',
135 'thumbnail': r
're:^https?://.*',
136 'timestamp': 1456259628,
137 'upload_date': '20160223',
138 'uploader': 'Barack Obama',
140 'skip': 'Gif on giphy.com gone',
142 # have 1080P, but only up to 720p in swf params
143 # data.video.story.attachments[].media
144 'url': 'https://www.facebook.com/cnn/videos/10155529876156509/',
145 'md5': '3f3798adb2b73423263e59376f1f5eb7',
147 'id': '10155529876156509',
149 'title': 'Holocaust survivor becomes US citizen',
150 'description': 'She survived the holocaust — and years later, she’s getting her citizenship so she can vote for Hillary Clinton http://cnn.it/2eERh5f',
151 'timestamp': 1477818095,
152 'upload_date': '20161030',
154 'thumbnail': r
're:^https?://.*',
158 # bigPipe.onPageletArrive ... onPageletArrive pagelet_group_mall
159 # data.node.comet_sections.content.story.attachments[].style_type_renderer.attachment.media
160 'url': 'https://www.facebook.com/yaroslav.korpan/videos/1417995061575415/',
162 'id': '1417995061575415',
164 'title': 'Yaroslav Korpan - Довгоочікуване відео',
165 'description': 'Довгоочікуване відео',
166 'timestamp': 1486648771,
167 'upload_date': '20170209',
168 'uploader': 'Yaroslav Korpan',
169 'uploader_id': '100000948048708',
172 'skip_download': True,
176 'url': 'https://www.facebook.com/LaGuiaDelVaron/posts/1072691702860471',
178 'id': '1072691702860471',
180 'title': 'md5:ae2d22a93fbb12dad20dc393a869739d',
181 'timestamp': 1477305000,
182 'upload_date': '20161024',
183 'uploader': 'La Guía Del Varón',
184 'thumbnail': r
're:^https?://.*',
187 'skip_download': True,
190 # data.node.comet_sections.content.story.attachments[].style_type_renderer.attachment.media
191 'url': 'https://www.facebook.com/groups/1024490957622648/permalink/1396382447100162/',
193 'id': '202882990186699',
195 'title': 'Elisabeth Ahtn - Hello? Yes your uber ride is here\n* Jukin...',
196 'description': 'Hello? Yes your uber ride is here\n* Jukin Media Verified *\nFind this video and others like it by visiting...',
197 'timestamp': 1486035513,
198 'upload_date': '20170202',
199 'uploader': 'Elisabeth Ahtn',
200 'uploader_id': '100013949973717',
203 'skip_download': True,
206 'url': 'https://www.facebook.com/video.php?v=10204634152394104',
207 'only_matching': True,
209 'url': 'https://www.facebook.com/amogood/videos/1618742068337349/?fref=nf',
210 'only_matching': True,
212 # data.mediaset.currMedia.edges
213 'url': 'https://www.facebook.com/ChristyClarkForBC/videos/vb.22819070941/10153870694020942/?type=2&theater',
214 'only_matching': True,
216 # data.video.story.attachments[].media
217 'url': 'facebook:544765982287235',
218 'only_matching': True,
220 # data.node.comet_sections.content.story.attachments[].style_type_renderer.attachment.media
221 'url': 'https://www.facebook.com/groups/164828000315060/permalink/764967300301124/',
222 'only_matching': True,
224 # data.video.creation_story.attachments[].media
225 'url': 'https://zh-hk.facebook.com/peoplespower/videos/1135894589806027/',
226 'only_matching': True,
229 'url': 'https://www.facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion/video.php?v=274175099429670',
230 'only_matching': True,
233 'url': 'https://www.facebook.com/onlycleverentertainment/videos/1947995502095005/',
234 'only_matching': True,
237 'url': 'https://www.facebook.com/WatchESLOne/videos/359649331226507/',
239 'id': '359649331226507',
241 'title': 'Fnatic vs. EG - Group A - Opening Match - ESL One Birmingham Day 1',
242 'description': '#ESLOne VoD - Birmingham Finals Day#1 Fnatic vs. @Evil Geniuses',
243 'timestamp': 1527084179,
244 'upload_date': '20180523',
245 'uploader': 'ESL One Dota 2',
246 'uploader_id': '234218833769558',
249 'skip_download': True,
252 # data.node.comet_sections.content.story.attachments[].style_type_renderer.attachment.all_subattachments.nodes[].media
253 'url': 'https://www.facebook.com/100033620354545/videos/106560053808006/',
255 'id': '106560053808006',
259 # data.video.story.attachments[].media
260 'url': 'https://www.facebook.com/watch/?v=647537299265662',
261 'only_matching': True,
263 # FIXME: https://github.com/yt-dlp/yt-dlp/issues/542
264 # data.node.comet_sections.content.story.attachments[].style_type_renderer.attachment.all_subattachments.nodes[].media
265 'url': 'https://www.facebook.com/PankajShahLondon/posts/10157667649866271',
267 'id': '10157667649866271',
271 # data.nodes[].comet_sections.content.story.attachments[].style_type_renderer.attachment.media
272 'url': 'https://m.facebook.com/Alliance.Police.Department/posts/4048563708499330',
274 'id': '117576630041613',
276 # TODO: title can be extracted from video page
277 'title': 'Facebook video #117576630041613',
278 'uploader_id': '189393014416438',
279 'upload_date': '20201123',
280 'timestamp': 1606162592,
282 'skip': 'Requires logging in',
284 # node.comet_sections.content.story.attached_story.attachments.style_type_renderer.attachment.media
285 'url': 'https://www.facebook.com/groups/ateistiskselskab/permalink/10154930137678856/',
287 'id': '211567722618337',
289 'title': 'Facebook video #211567722618337',
290 'uploader_id': '127875227654254',
291 'upload_date': '20161122',
292 'timestamp': 1479793574,
296 # data.video.creation_story.attachments[].media
297 'url': 'https://www.facebook.com/watch/live/?v=1823658634322275',
298 'only_matching': True,
300 'url': 'https://www.facebook.com/watchparty/211641140192478',
302 'id': '211641140192478',
305 'skip': 'Requires logging in',
307 _SUPPORTED_PAGLETS_REGEX
= r
'(?:pagelet_group_mall|permalink_video_pagelet|hyperfeed_story_id_[0-9a-f]+)'
309 'graphURI': '/api/graphql/'
313 def _extract_urls(webpage
):
315 for mobj
in re
.finditer(
316 r
'<iframe[^>]+?src=(["\'])(?P
<url
>https?
://www\
.facebook\
.com
/(?
:video
/embed|plugins
/video\
.php
).+?
)\
1',
318 urls.append(mobj.group('url
'))
320 # see https://developers.facebook.com/docs/plugins/embedded-video-player
321 for mobj in re.finditer(r'''(?x)<div[^>]+
322 class=(?P<q1>[\'"])[^\'"]*\bfb-(?:video|post)\b[^\'"]*(?P=q1)[^>]+
323 data-href=(?P<q2>[\'"])(?P<url>(?:https?:)?//(?:www\.)?facebook.com/.+?)(?P=q2)''', webpage):
324 urls.append(mobj.group('url
'))
328 useremail, password = self._get_login_info()
329 if useremail is None:
332 login_page_req = sanitized_Request(self._LOGIN_URL)
333 self._set_cookie('facebook
.com
', 'locale
', 'en_US
')
334 login_page = self._download_webpage(login_page_req, None,
335 note='Downloading login page
',
336 errnote='Unable to download login page
')
337 lsd = self._search_regex(
338 r'<input type="hidden" name
="lsd" value
="([^"]*)"',
340 lgnrnd = self._search_regex(r'name="lgnrnd
" value="([^
"]*?)"', login_page, 'lgnrnd
')
347 'next
': 'http
://facebook
.com
/home
.php
',
348 'default_persistent
': '0',
349 'legacy_return
': '1',
353 request = sanitized_Request(self._LOGIN_URL, urlencode_postdata(login_form))
354 request.add_header('Content
-Type
', 'application
/x
-www
-form
-urlencoded
')
356 login_results = self._download_webpage(request, None,
357 note='Logging
in', errnote='unable to fetch login page
')
358 if re.search(r'<form(.*)name
="login"(.*)</form
>', login_results) is not None:
359 error = self._html_search_regex(
360 r'(?s
)<div
[^
>]+class=(["\']).*?login_error_box.*?\1[^>]*><div[^>]*>.*?</div><div[^>]*>(?P<error>.+?)</div>',
361 login_results, 'login error', default=None, group='error')
363 raise ExtractorError('Unable to login: %s' % error, expected=True)
364 self.report_warning('unable to log in: bad username/password, or exceeded login rate limit (~3/min). Check credentials or wait.')
367 fb_dtsg = self._search_regex(
368 r'name="fb_dtsg
" value="(.+?
)"', login_results, 'fb_dtsg', default=None)
369 h = self._search_regex(
370 r'name="h
"\s+(?:\w+="[^
"]+"\s
+)*?value
="([^"]+)"', login_results, 'h', default=None)
372 if not fb_dtsg or not h:
378 'name_action_selected': 'dont_save',
380 check_req = sanitized_Request(self._CHECKPOINT_URL, urlencode_postdata(check_form))
381 check_req.add_header('Content-Type', 'application/x-www-form-urlencoded')
382 check_response = self._download_webpage(check_req, None,
383 note='Confirming login')
384 if re.search(r'id="checkpointSubmitButton
"', check_response) is not None:
385 self.report_warning('Unable to confirm login, you have to login in your browser and authorize the login.')
386 except network_exceptions as err:
387 self.report_warning('unable to log in: %s' % error_to_compat_str(err))
390 def _real_initialize(self):
393 def _extract_from_url(self, url, video_id):
394 webpage = self._download_webpage(
395 url.replace('://m.facebook.com/', '://www.facebook.com/'), video_id)
397 def extract_metadata(webpage):
398 video_title = self._html_search_regex(
399 r'<h2\s+[^>]*class="uiHeaderTitle
"[^>]*>([^<]*)</h2>', webpage,
400 'title', default=None)
402 video_title = self._html_search_regex(
403 r'(?s)<span class="fbPhotosPhotoCaption
".*?id="fbPhotoPageCaption
"><span class="hasCaption
">(.*?)</span>',
404 webpage, 'alternative title', default=None)
406 video_title = self._html_search_meta(
407 ['og:title', 'twitter:title', 'description'],
408 webpage, 'title', default=None)
410 video_title = limit_length(video_title, 80)
412 video_title = 'Facebook video #%s' % video_id
413 description = self._html_search_meta(
414 ['description', 'og:description', 'twitter:description'],
415 webpage, 'description', default=None)
416 uploader = clean_html(get_element_by_id(
417 'fbPhotoPageAuthorName', webpage)) or self._search_regex(
418 r'ownerName\s*:\s*"([^
"]+)"', webpage, 'uploader
',
419 default=None) or self._og_search_title(webpage, fatal=False)
420 timestamp = int_or_none(self._search_regex(
421 r'<abbr
[^
>]+data
-utime
=["\'](\d+)', webpage,
422 'timestamp', default=None))
423 thumbnail = self._html_search_meta(
424 ['og:image', 'twitter:image'], webpage, 'thumbnail', default=None)
425 # some webpages contain unretrievable thumbnail urls
426 # like https://lookaside.fbsbx.com/lookaside/crawler/media/?media_id=10155168902769113&get_thumbnail=1
427 # in https://www.facebook.com/yaroslav.korpan/videos/1417995061575415/
428 if thumbnail and not re.search(r'\.(?:jpg|png)', thumbnail):
430 view_count = parse_count(self._search_regex(
431 r'\bviewCount\s*:\s*["\']([\d
,.]+)', webpage, 'view count
',
434 'title
': video_title,
435 'description
': description,
436 'uploader
': uploader,
437 'timestamp
': timestamp,
438 'thumbnail
': thumbnail,
439 'view_count
': view_count,
441 info_json_ld = self._search_json_ld(webpage, video_id, default={})
442 if info_json_ld.get('title
'):
443 info_json_ld['title
'] = limit_length(
444 re.sub(r'\s
*\|\s
*Facebook$
', '', info_json_ld['title
']), 80)
445 return merge_dicts(info_json_ld, info_dict)
449 def extract_video_data(instances):
451 for item in instances:
452 if try_get(item, lambda x: x[1][0]) == 'VideoConfig
':
453 video_item = item[2][0]
454 if video_item.get('video_id
'):
455 video_data.append(video_item['videoData
'])
458 server_js_data = self._parse_json(self._search_regex(
459 [r'handleServerJS\
(({.+}
)(?
:\
);|
,")', r'\bs\.handle\(({.+?})\);'],
460 webpage, 'server js data', default='{}'), video_id, fatal=False)
463 video_data = extract_video_data(server_js_data.get('instances', []))
465 def extract_from_jsmods_instances(js_data):
467 return extract_video_data(try_get(
468 js_data, lambda x: x['jsmods']['instances'], list) or [])
470 def extract_dash_manifest(video, formats):
471 dash_manifest = video.get('dash_manifest')
473 formats.extend(self._parse_mpd_formats(
474 compat_etree_fromstring(compat_urllib_parse_unquote_plus(dash_manifest))))
476 def process_formats(formats):
477 # Downloads with browser's User-Agent are rate limited. Working around
478 # with non-browser User-Agent.
480 f.setdefault('http_headers', {})['User-Agent'] = 'facebookexternalhit/1.1'
482 self._sort_formats(formats)
484 def extract_relay_data(_filter):
485 return self._parse_json(self._search_regex(
486 r'handleWithCustomApplyEach\([^,]+,\s*({.*?%s.*?})\);' % _filter,
487 webpage, 'replay data', default='{}'), video_id, fatal=False) or {}
489 def extract_relay_prefetched_data(_filter):
490 replay_data = extract_relay_data(_filter)
491 for require in (replay_data.get('require') or []):
492 if require[0] == 'RelayPrefetchedStreamCache':
493 return try_get(require, lambda x: x[3][1]['__bbox']['result']['data'], dict) or {}
496 server_js_data = self._parse_json(self._search_regex([
497 r'bigPipe\.onPageletArrive\(({.+?})\)\s*;\s*}\s*\)\s*,\s*["\']onPageletArrive\s
+' + self._SUPPORTED_PAGLETS_REGEX,
498 r'bigPipe\
.onPageletArrive\
(({.*?id\s*:\s*"%s".*?}
)\
);' % self._SUPPORTED_PAGLETS_REGEX
499 ], webpage, 'js data
', default='{}'), video_id, js_to_json, False)
500 video_data = extract_from_jsmods_instances(server_js_data)
503 data = extract_relay_prefetched_data(
504 r'"(?:dash_manifest|playable_url(?:_quality_hd)?)"\s
*:\s
*"[^"]+"')
508 def parse_graphql_video(video):
510 q = qualities(['sd', 'hd'])
511 for (suffix, format_id) in [('', 'sd'), ('_quality_hd', 'hd')]:
512 playable_url = video.get('playable_url' + suffix)
516 'format_id': format_id,
517 'quality': q(format_id),
520 extract_dash_manifest(video, formats)
521 process_formats(formats)
522 v_id = video.get('videoId') or video.get('id') or video_id
526 'thumbnail': try_get(video, lambda x: x['thumbnailImage']['uri']),
527 'uploader_id': try_get(video, lambda x: x['owner']['id']),
528 'timestamp': int_or_none(video.get('publish_time')),
529 'duration': float_or_none(video.get('playable_duration_in_ms'), 1000),
531 description = try_get(video, lambda x: x['savable_description']['text'])
532 title = video.get('name')
536 'description': description,
539 info['title'] = description or 'Facebook video #%s' % v_id
542 def parse_attachment(attachment, key='media'):
543 media = attachment.get(key) or {}
544 if media.get('__typename') == 'Video':
545 return parse_graphql_video(media)
547 nodes = data.get('nodes') or []
548 node = data.get('node') or {}
549 if not nodes and node:
552 story = try_get(node, lambda x: x['comet_sections']['content']['story'], dict) or {}
553 attachments = try_get(story, [
554 lambda x: x['attached_story']['attachments'],
555 lambda x: x['attachments']
557 for attachment in attachments:
558 attachment = try_get(attachment, lambda x: x['style_type_renderer']['attachment'], dict)
559 ns = try_get(attachment, lambda x: x['all_subattachments']['nodes'], list) or []
562 parse_attachment(attachment)
564 edges = try_get(data, lambda x: x['mediaset']['currMedia']['edges'], list) or []
566 parse_attachment(edge, key='node')
568 video = data.get('video') or {}
570 attachments = try_get(video, [
571 lambda x: x['story']['attachments'],
572 lambda x: x['creation_story']['attachments']
574 for attachment in attachments:
575 parse_attachment(attachment)
577 parse_graphql_video(video)
580 return self.playlist_result(entries, video_id)
582 video_info = entries[0]
583 webpage_info = extract_metadata(webpage)
584 # honor precise duration in video info
585 if video_info.get('duration'):
586 webpage_info['duration'] = video_info['duration']
587 return merge_dicts(webpage_info, video_info)
590 m_msg = re.search(r'class="[^
"]*uiInterstitialContent[^"]*"><div>(.*?)</div>', webpage)
591 if m_msg is not None:
592 raise ExtractorError(
593 'The video is not available, Facebook said: "%s"' % m_msg.group(1),
595 elif any(p in webpage for p in (
596 '>You must log in to continue',
598 'id="loginbutton
"')):
599 self.raise_login_required()
601 if not video_data and '/watchparty/' in url:
603 'doc_id': 3731964053542869,
604 'variables': json.dumps({
605 'livingRoomID': video_id,
609 prefetched_data = extract_relay_prefetched_data(r'"login_data
"\s*:\s*{')
611 lsd = try_get(prefetched_data, lambda x: x['login_data']['lsd'], dict)
613 post_data[lsd['name']] = lsd['value']
615 relay_data = extract_relay_data(r'\[\s*"RelayAPIConfigDefaults
"\s*,')
616 for define in (relay_data.get('define') or []):
617 if define[0] == 'RelayAPIConfigDefaults':
618 self._api_config = define[2]
620 living_room = self._download_json(
621 urljoin(url, self._api_config['graphURI']), video_id,
622 data=urlencode_postdata(post_data))['data']['living_room']
625 for edge in (try_get(living_room, lambda x: x['recap']['watched_content']['edges']) or []):
626 video = try_get(edge, lambda x: x['node']['video']) or {}
627 v_id = video.get('id')
630 v_id = compat_str(v_id)
631 entries.append(self.url_result(
632 self._VIDEO_PAGE_TEMPLATE % v_id,
633 self.ie_key(), v_id, video.get('name')))
635 return self.playlist_result(entries, video_id)
638 # Video info not in first request, do a secondary request using
639 # tahoe player specific URL
640 tahoe_data = self._download_webpage(
641 self._VIDEO_PAGE_TAHOE_TEMPLATE % video_id, video_id,
642 data=urlencode_postdata({
644 '__pc': self._search_regex(
645 r'pkg_cohort["\']\s
*:\s
*["\'](.+?)["\']', webpage,
646 'pkg cohort
', default='PHASED
:DEFAULT
'),
647 '__rev
': self._search_regex(
648 r'client_revision
["\']\s*:\s*(\d+),', webpage,
649 'client revision', default='3944515'),
650 'fb_dtsg': self._search_regex(
651 r'"DTSGInitialData
"\s*,\s*\[\]\s*,\s*{\s*"token
"\s*:\s*"([^
"]+)"',
652 webpage, 'dtsg token
', default=''),
655 'Content
-Type
': 'application
/x
-www
-form
-urlencoded
',
657 tahoe_js_data = self._parse_json(
659 r'for\s
+\
(\s
*;\s
*;\s
*\
)\s
*;(.+)', tahoe_data,
660 'tahoe js data
', default='{}'),
661 video_id, fatal=False)
662 video_data = extract_from_jsmods_instances(tahoe_js_data)
665 raise ExtractorError('Cannot parse data
')
667 if len(video_data) > 1:
670 video_url = v[0].get('video_url
')
673 entries.append(self.url_result(urljoin(
674 url, video_url), self.ie_key(), v[0].get('video_id
')))
675 return self.playlist_result(entries, video_id)
676 video_data = video_data[0]
681 format_id = f['stream_type
']
682 if f and isinstance(f, dict):
684 if not f or not isinstance(f, list):
686 for quality in ('sd
', 'hd
'):
687 for src_type in ('src
', 'src_no_ratelimit
'):
688 src = f[0].get('%s_%s' % (quality, src_type))
690 preference = -10 if format_id == 'progressive
' else 0
694 'format_id
': '%s_%s_%s' % (format_id, quality, src_type),
696 'quality
': preference,
698 extract_dash_manifest(f[0], formats)
699 subtitles_src = f[0].get('subtitles_src
')
701 subtitles.setdefault('en
', []).append({'url': subtitles_src})
703 process_formats(formats)
708 'subtitles
': subtitles,
710 info_dict.update(extract_metadata(webpage))
714 def _real_extract(self, url):
715 video_id = self._match_id(url)
717 real_url = self._VIDEO_PAGE_TEMPLATE % video_id if url.startswith('facebook
:') else url
718 return self._extract_from_url(real_url, video_id)
721 class FacebookPluginsVideoIE(InfoExtractor):
722 _VALID_URL = r'https?
://(?
:[\w
-]+\
.)?facebook\
.com
/plugins
/video\
.php
\?.*?
\bhref
=(?P
<id>https
.+)'
725 'url
': 'https
://www
.facebook
.com
/plugins
/video
.php?href
=https
%3A
%2F
%2Fwww
.facebook
.com
%2Fgov
.sg
%2Fvideos
%2F10154383743583686
%2F
&show_text
=0&width
=560',
726 'md5
': '5954e92cdfe51fe5782ae9bda7058a07
',
728 'id': '10154383743583686',
730 'title
': 'What to do during the haze?
',
731 'uploader
': 'Gov
.sg
',
732 'upload_date
': '20160826',
733 'timestamp
': 1472184808,
735 'add_ie
': [FacebookIE.ie_key()],
737 'url
': 'https
://www
.facebook
.com
/plugins
/video
.php?href
=https
%3A
%2F
%2Fwww
.facebook
.com
%2Fvideo
.php
%3Fv
%3D10204634152394104
',
738 'only_matching
': True,
740 'url
': 'https
://www
.facebook
.com
/plugins
/video
.php?href
=https
://www
.facebook
.com
/gov
.sg
/videos
/10154383743583686/&show_text
=0&width
=560',
741 'only_matching
': True,
744 def _real_extract(self, url):
745 return self.url_result(
746 compat_urllib_parse_unquote(self._match_id(url)),