projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
824fa51
)
[facebook] Bypass download rate limits (closes #21018)
author
Sergey M․
<dstftw@gmail.com>
Sat, 19 Oct 2019 16:56:36 +0000
(23:56 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 19 Oct 2019 16:56:36 +0000
(23:56 +0700)
youtube_dl/extractor/facebook.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/facebook.py
b/youtube_dl/extractor/facebook.py
index a3dcdca3e2bd424bd7a24a800bdf457ec37a033f..a56f85c216177810e2ea217dd4309aee6a453b00 100644
(file)
--- a/
youtube_dl/extractor/facebook.py
+++ b/
youtube_dl/extractor/facebook.py
@@
-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(