Browse Source

[facebook] Bypass download rate limits (closes #21018)

master
Sergey M․ 5 years ago
parent
commit
2297c0d7d9
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      youtube_dl/extractor/facebook.py

+ 5
- 0
youtube_dl/extractor/facebook.py View File

@ -405,6 +405,11 @@ class FacebookIE(InfoExtractor):
if not formats:
raise ExtractorError('Cannot find video formats')
# Downloads with browser's User-Agent are rate limited. Working around
# with non-browser User-Agent.
for f in formats:
f.setdefault('http_headers', {})['User-Agent'] = 'facebookexternalhit/1.1'
self._sort_formats(formats)
video_title = self._html_search_regex(


Loading…
Cancel
Save