aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkclauhk <78251477+kclauhk@users.noreply.github.com>2024-01-29 02:39:14 +0800
committerGitHub <noreply@github.com>2024-01-28 18:39:14 +0000
commit5b68c478fb0b93ea6b8fac23f50e12217fa063db (patch)
tree292d9b1f5b8364b32aff356286de10646156943f
parent9526b1f179d19f75284eceaa5e0ee381af18cf19 (diff)
[ie/facebook] Set format HTTP chunk size (#9058)
Closes #8197 Authored by: bashonly, kclauhk
-rw-r--r--yt_dlp/extractor/facebook.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/yt_dlp/extractor/facebook.py b/yt_dlp/extractor/facebook.py
index 26cfda538..84856abe1 100644
--- a/yt_dlp/extractor/facebook.py
+++ b/yt_dlp/extractor/facebook.py
@@ -564,7 +564,11 @@ class FacebookIE(InfoExtractor):
# Downloads with browser's User-Agent are rate limited. Working around
# with non-browser User-Agent.
for f in info['formats']:
+ # Downloads with browser's User-Agent are rate limited. Working around
+ # with non-browser User-Agent.
f.setdefault('http_headers', {})['User-Agent'] = 'facebookexternalhit/1.1'
+ # Formats larger than ~500MB will return error 403 unless chunk size is regulated
+ f.setdefault('downloader_options', {})['http_chunk_size'] = 250 << 20
def extract_relay_data(_filter):
return self._parse_json(self._search_regex(