aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2020-12-10 12:10:33 +0100
committerRemita Amine <remitamine@gmail.com>2020-12-10 12:10:33 +0100
commit37fd242342a04613317fd7f85170a20fb7323efe (patch)
tree3a31be0e2748e1dc74327b4ca3f320115df3b851 /youtube_dl
parentaee1f871681af7d6cbd26e33f9fe3e63f742167f (diff)
[facebook] try to reduce unessessary tahoe requests
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/facebook.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/youtube_dl/extractor/facebook.py b/youtube_dl/extractor/facebook.py
index 7459fde34..c23ff298e 100644
--- a/youtube_dl/extractor/facebook.py
+++ b/youtube_dl/extractor/facebook.py
@@ -328,11 +328,10 @@ class FacebookIE(InfoExtractor):
js_data, lambda x: x['jsmods']['instances'], list) or [])
if not video_data:
- server_js_data = self._parse_json(
- self._search_regex(
- r'bigPipe\.onPageletArrive\(({.+?})\)\s*;\s*}\s*\)\s*,\s*["\']onPageletArrive\s+(?:pagelet_group_mall|permalink_video_pagelet|hyperfeed_story_id_\d+)',
- webpage, 'js data', default='{}'),
- video_id, transform_source=js_to_json, fatal=False)
+ server_js_data = self._parse_json(self._search_regex([
+ r'bigPipe\.onPageletArrive\(({.+?})\)\s*;\s*}\s*\)\s*,\s*["\']onPageletArrive\s+(?:pagelet_group_mall|permalink_video_pagelet|hyperfeed_story_id_\d+)',
+ r'bigPipe\.onPageletArrive\(({.*?id\s*:\s*"permalink_video_pagelet".*?})\);'
+ ], webpage, 'js data', default='{}'), video_id, js_to_json, False)
video_data = extract_from_jsmods_instances(server_js_data)
if not video_data: