Open wsbblyy opened 2 years ago
see under authentication options - https://github.com/ytdl-org/youtube-dl/blob/master/README.md#readme
Thanks for reply, if you see the Command-line args in my debug log, I did pass the -2
argument, and I tried multiple times, it always give me this error ERROR: This video is only available for registered users
.
see under authentication options - https://github.com/ytdl-org/youtube-dl/blob/master/README.md#readme
strange, i was able to download this video - https://www.facebook.com/106937041769662/videos/601957961078153/ without any authentication. are you signed in to your facebook account ??
Yes, I signed in to my Facebook account, but it didn't go thru the 2 factor approvals, the program should perform like this:
sign in --> 2 factor approvals --> go download videos,
I debugged the code a little bit, I think it doesn't do anything about the 2 factor approvals
part.
I assume you don't have the 2 factor approvals on you facebook account that's why you can download the video.
The following code is from the youtube-dl library ./extractor/facebook.py 343-360
, which performs facebook login, and I didn't find anything about the 2 factor approvals.
login_results = self._download_webpage(request, None,note='Logging in', errnote='unable to fetch login page')
if re.search(r'<form(.*)name="login"(.*)</form>', login_results) is not None:
error = self._html_search_regex(
r'(?s)<div[^>]+class=(["\']).*?login_error_box.*?\1[^>]*><div[^>]*>.*?</div><div[^>]*>(?P<error>.+?)</div>',
login_results, 'login error', default=None, group='error')
if error:
raise ExtractorError('Unable to login: %s' % error, expected=True)
self._downloader.report_warning('unable to log in: bad username/password, or exceeded login rate limit (~3/min). Check credentials or wait.')
return
fb_dtsg = self._search_regex(r'name="fb_dtsg" value="(.+?)"', login_results, 'fb_dtsg', default=None)
h = self._search_regex(r'name="h"\s+(?:\w+="[^"]+"\s+)*?value="([^"]+)"', login_results, 'h', default=None)
if not fb_dtsg or not h:
return
strange, i was able to download this video - https://www.facebook.com/106937041769662/videos/601957961078153/ without any authentication. are you signed in to your facebook account ??
Facebook is tricky. Even if a video can be viewed without login, the login page may be returned to youtube-dl. If there's no problem at first, the login page may be returned even to browsers after repeated attempts. Or It may be related to your location or network.
For your URL, I too can download the video without login info. If I use a proxy in other countries, sometimes login page is returned, sometimes still no problem.
What users can do would be:
--cookies
(without -u
and -p
)
but you may get blocked if you try many times--proxy
in other countries
Checklist
Verbose log
Description
Trying to download a facebook post video, debug log shows I successfully logged in, but still shows
This video is only available for registered users.
. I went thru the facebook login code, didn't find anything about TWOFACTOR functionality, am I missing something?