Skip to content

Commit

Permalink
[facebook] Bypass download rate limits (closes ytdl-org#21018)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Oct 19, 2019
1 parent 824fa51 commit 2297c0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions youtube_dl/extractor/facebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ def extract_from_jsmods_instances(js_data):
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(
Expand Down

0 comments on commit 2297c0d

Please sign in to comment.