Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[facebook] Cannot parse data #4311

Open
9 tasks done
SillyCatto opened this issue Jul 9, 2022 · 96 comments · May be fixed by #8983
Open
9 tasks done

[facebook] Cannot parse data #4311

SillyCatto opened this issue Jul 9, 2022 · 96 comments · May be fixed by #8983
Labels
can-share-account Someone is willing to provide account details for development regression Works in youtube-dl/older yt-dlp site-bug Issue with a specific website

Comments

@SillyCatto
Copy link

Checklist

Region

Bangladesh

Provide a description that is worded well enough to be understood

Downloading worked perfectly fine a just few days ago but now any facebook video link in "facebook.com/. . ./ videos/ . . ." format throws this error.
I have checked a similar type of issue #4289 , but it works fine on my side. The aforementioned link format, however, shows this error

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

❯ yt-dlp.exe -vU "https://www.facebook.com/100015388953240/videos/424804832900683/"
[debug] Command-line config: ['-vU', 'https://www.facebook.com/100015388953240/videos/424804832900683/']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.29 [9d339c4] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] exe versions: ffmpeg 5.0-full_build-www.gyan.dev (setts), ffprobe 5.0-full_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/download/2022.06.29/_update_spec
Latest version: 2022.06.29, Current version: 2022.06.29
yt-dlp is up to date (2022.06.29)
[debug] [facebook] Extracting URL: https://www.facebook.com/100015388953240/videos/424804832900683/
[facebook] 424804832900683: Downloading webpage
[facebook] 424804832900683: Downloading webpage
ERROR: [facebook] 424804832900683: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 640, in extract
  File "yt_dlp\extractor\facebook.py", line 713, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 659, in _extract_from_url
@SillyCatto SillyCatto added site-bug Issue with a specific website triage Untriaged issue labels Jul 9, 2022
@gamer191

This comment was marked as resolved.

@SillyCatto

This comment was marked as resolved.

@pukkandan

This comment was marked as resolved.

@pukkandan pukkandan added invalid This doesn't seem right and removed triage Untriaged issue labels Jul 10, 2022
@SillyCatto
Copy link
Author

Well, the content is not private, its shared to a public group. Online downloader sites works just fine.

However, I attempted with --cookies and also --cookies-from-browser flags to pass cookies, but its the same error.
yt-dlp
ytdlp_2

@pukkandan

This comment was marked as resolved.

@pukkandan pukkandan removed the invalid This doesn't seem right label Jul 11, 2022
@SillyCatto

This comment was marked as resolved.

@gamer191

This comment was marked as resolved.

@SillyCatto

This comment was marked as resolved.

@pukkandan

This comment was marked as spam.

@pukkandan pukkandan added account-needed Account details are needed to test/fix this can-share-account Someone is willing to provide account details for development labels Jul 11, 2022
@SillyCatto

This comment was marked as resolved.

@pukkandan

This comment was marked as resolved.

@johnsonbrians
Copy link

I'm having the same issue. This worked for me two weeks ago. For the past two weeks I get this error. I've tried a few different Facebook videos (all private videos) and they get the same error.

yt-dlp.exe -vU --cookies facebook.com_cookies.txt https://m.facebook.com/groups/1431367000434525/permalink/3184874755083732/?_rdr
[debug] Command-line config: ['-vU', '--cookies', 'facebook.com_cookies.txt', 'https://m.facebook.com/groups/1431367000434525/permalink/3184874755083732/?_rdr']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2022.06.29 [9d339c4] (win32_exe)
[debug] Python 3.8.10 (CPython 64bit) - Windows-10-10.0.19044-SP0
[debug] Checking exe version: ffmpeg -bsfs
[debug] Checking exe version: avconv -bsfs
[debug] Checking exe version: ffprobe -bsfs
[debug] Checking exe version: avprobe -bsfs
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.15.0, brotli-1.0.9, certifi-2022.06.15, mutagen-1.45.1, sqlite3-2.6.0, websockets-10.3
[debug] Proxy map: {}
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
[debug] Downloading _update_spec from https://github.com/yt-dlp/yt-dlp/releases/download/2022.06.29/_update_spec
Latest version: 2022.06.29, Current version: 2022.06.29
yt-dlp is up to date (2022.06.29)
[debug] [facebook] Extracting URL: https://m.facebook.com/groups/1431367000434525/permalink/3184874755083732/?_rdr
[facebook] 3184874755083732: Downloading webpage
[facebook] 3184874755083732: Downloading webpage
ERROR: [facebook] 3184874755083732: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 640, in extract
  File "yt_dlp\extractor\facebook.py", line 713, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 659, in _extract_from_url

@Guztaver

This comment was marked as duplicate.

@pukkandan pukkandan added the regression Works in youtube-dl/older yt-dlp label Aug 3, 2022
@ohhai

This comment was marked as duplicate.

@sa-myan
Copy link

sa-myan commented Aug 5, 2022

I am pretty sure it's an account-related problem, excessive use of yt-dlp can cause some kind of "invisible ban".

Attempting to use the cookies of an account with this kind of "ban" (even with public videos that are downloaded normally with no cookies on the same machine) will result in the error mentioned in this issue, another attempt within 0 - 10 minutes will lock the account and "someone may have tried to access your account".

In the past (until about a few months ago) you could easily know you currently have this kind of "ban" as almost every non-public video you normally have access to would give "content isn't available at the moment", and you could easily know when it ends.
Currently, everything works as expected on browser but using yt-dlp with cookies causes the aforementioned error, and there is no way to know if the "ban" has ended other than trial and error.

I am 95% sure about this, but the only way to prove this theory is to use a clean account on a clean IP.

@dexeonify
Copy link

dexeonify commented Aug 5, 2022

As mentioned in #4477 (comment) (I've also tested using the same cookies.txt file), youtube-dl works, but not yt-dlp. So it's caused by a regression, not Facebook "banning" you.

@ohhai

This comment was marked as off-topic.

@pukkandan

This comment was marked as resolved.

@pukkandan

This comment was marked as resolved.

@ohhai

This comment was marked as resolved.

@johnsonbrians

This comment was marked as resolved.

@dirkf

This comment was marked as outdated.

@jheled
Copy link

jheled commented Sep 4, 2023

yt-dlp --user-agent "Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0" --add-header 'Sec-Fetch-Mode:' --extract-audio --audio-format mp3 https://web.facebook.com/watch/?v=2139244499701931
[facebook] Extracting URL: https://web.facebook.com/watch/?v=2139244499701931
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
ERROR: [facebook] 2139244499701931: Cannot parse data; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U

@dirkf
Copy link
Contributor

dirkf commented Sep 4, 2023

Yet:

$ yt-dlp -v -F 'https://web.facebook.com/watch/?v=2139244499701931' --user-agent 'Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0' --add-header 'Sec-Fetch-Mode:'
[debug] Command-line config: ['-v', '-F', 'https://web.facebook.com/watch/?v=2139244499701931', '--user-agent', 'Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0', '--add-header', 'Sec-Fetch-Mode:']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.06.22 [812cdfa06] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: de4cf77ec
[debug] Python 3.9.16 (CPython i686 32bit) - Linux-4.4.0-210-generic-i686-with-glibc2.23 (OpenSSL 1.1.1v  1 Aug 2023, glibc 2.23)
[debug] exe versions: ffmpeg 4.3, ffprobe 4.3
[debug] Optional libraries: Cryptodome-3.11.0, certifi-2019.11.28, secretstorage-3.2.0, sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1851 extractors
[facebook] Extracting URL: https://web.facebook.com/watch/?v=2139244499701931
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 2139244499701931:
ID                              EXT RESOLUTION │ PROTO │ VCODEC  ACODEC
────────────────────────────────────────────────────────────────────────
progressive_sd_src              mp4 unknown    │ https │ unknown unknown
progressive_sd_src_no_ratelimit mp4 unknown    │ https │ unknown unknown
$

Apparently FB is looking at the final version number, not the rv.

With this page yt-dl nightly gets:

[facebook] 2139244499701931: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Found (caused by HTTPError()) ....

But that's another problem.

@jheled
Copy link

jheled commented Sep 4, 2023

yt-dlp -v -F 'https://web.facebook.com/watch/?v=2139244499701931' --user-agent 'Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0' --add-header 'Sec-Fetch-Mode:'
[debug] Command-line config: ['-v', '-F', 'https://web.facebook.com/watch/?v=2139244499701931', '--user-agent', 'Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0', '--add-header', 'Sec-Fetch-Mode:']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out UTF-8, error UTF-8, screen UTF-8
[debug] yt-dlp version stable@2023.07.06 [b532a34] (zip)
[debug] Python 3.7.3 (CPython x86_64 64bit) - Linux-5.0.0-38-generic-x86_64-with-Ubuntu-19.04-disco (OpenSSL 1.1.1b 26 Feb 2019, glibc 2.29)
[debug] exe versions: ffmpeg 4.1.3, ffprobe 4.1.3, phantomjs 2.1.1
[debug] Optional libraries: Crypto-broken 2.6.1, certifi-2018.08.24, secretstorage-2.3.1, sqlite3-2.6.0
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[facebook] Extracting URL: https://web.facebook.com/watch/?v=2139244499701931
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
ERROR: [facebook] 2139244499701931: Cannot parse data; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
File "/home/joseph/bin/yt-dlp/yt_dlp/extractor/common.py", line 710, in extract
ie_result = self._real_extract(url)
File "/home/joseph/bin/yt-dlp/yt_dlp/extractor/facebook.py", line 707, in _real_extract
return self._extract_from_url(real_url, video_id)
File "/home/joseph/bin/yt-dlp/yt_dlp/extractor/facebook.py", line 654, in _extract_from_url
raise ExtractorError('Cannot parse data')

@dirkf
Copy link
Contributor

dirkf commented Sep 4, 2023

OpenSSL 1.1.1b
Or Crypto-broken vs Cryptodome
Or Python 3.7 vs 3.9 (but I get the same result with Py 3.11 and no Crypto*).
Or location/IP.
Or maybe something related to cookie changes between the two yt-dlp versions.

@renandecarlo
Copy link

renandecarlo commented Sep 4, 2023

If this helps, I'm having this on Windows as well. Both in v2023.07.06 and v2023.06.22 , cryptodome, and openssl 1.1.1k.
I tried to VPN to some other locations near the video source (Israel), but it did not work either.

@dirkf can you provide results of --print-traffic --write-pages?

#yt-dlp v2023.07.06
yt-dlp -v -F "https://web.facebook.com/watch/?v=2139244499701931" --user-agent "Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0" --add-header "Sec-Fetch-Mode:"
[debug] Command-line config: ['-v', '-F', 'https://web.facebook.com/watch/?v=2139244499701931', '--user-agent', 'Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0', '--add-header', 'Sec-Fetch-Mode:']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.07.06 [b532a3481] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 5.0.1-essentials_build-www.gyan.dev (setts), ffprobe 5.0.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1855 extractors
[facebook] Extracting URL: https://web.facebook.com/watch/?v=2139244499701931
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
ERROR: [facebook] 2139244499701931: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 710, in extract
  File "yt_dlp\extractor\facebook.py", line 707, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 654, in _extract_from_url
#yt-dlp v2023.06.22
yt-dlp -v -F "https://web.facebook.com/watch/?v=2139244499701931" --user-agent "Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0" --add-header "Sec-Fetch-Mode:"
[debug] Command-line config: ['-v', '-F', 'https://web.facebook.com/watch/?v=2139244499701931', '--user-agent', 'Mozilla/5.0 (Windows NT 6.0; rv:89.0) Gecko/20100101 Firefox/89.0', '--add-header', 'Sec-Fetch-Mode:']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2023.06.22 [812cdfa06] (win_exe)
[debug] Python 3.8.10 (CPython AMD64 64bit) - Windows-10-10.0.19045-SP0 (OpenSSL 1.1.1k  25 Mar 2021)
[debug] exe versions: ffmpeg 5.0.1-essentials_build-www.gyan.dev (setts), ffprobe 5.0.1-essentials_build-www.gyan.dev
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.05.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1851 extractors
[facebook] Extracting URL: https://web.facebook.com/watch/?v=2139244499701931
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
ERROR: [facebook] 2139244499701931: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 708, in extract
  File "yt_dlp\extractor\facebook.py", line 707, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 654, in _extract_from_url

@Vangelis66
Copy link

Vangelis66 commented Sep 4, 2023

How do I get "youtube-dl version 2023.09.03.2215" used in the last post???

This is a self-compiled Windows 32-bit build, using CPython 3.4.10, from source code snapshot "master-git-20230903-g66ab081"; since you're a Linux user, it shouldn't be difficult for you to compile it yourself or, even, run it directly from source 😉 ; of course, this is OT for this tracker...

I think it's more likely that b1156c1 / d14cbdd was the culprit, since FB's fingerprinting seems to be very http header-focused

... I'm not a coder, I've stated that multiple times 😉 , but both these commits (in Jan 2022) were authored after v2021.12.25, which is now also broken in FB, yielding the error in this issue's title:

yt-dlp_x86 -vF "https://www.facebook.com/RoeiFreilich/videos/2139244499701931/" => 

[debug] Command-line config: ['-vF', 'https://www.facebook.com/RoeiFreilich/videos/2139244499701931/']
[debug] Encodings: locale cp1253, fs utf-8, out utf-8 (No ANSI), err utf-8 (No ANSI), pref cp1253
[debug] yt-dlp version 2021.12.25 [87e0499] (win_exe)
[debug] Python version 3.7.9 (CPython 32bit) - Windows-Vista-6.0.6003-SP2
[debug] exe versions: none
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [facebook] Extracting URL: https://www.facebook.com/RoeiFreilich/videos/2139244499701931/
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
ERROR: [facebook] 2139244499701931: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; type  yt-dlp -U  to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.; please report this issue on  https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; type  yt-dlp -U  to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.
  File "yt_dlp\extractor\common.py", line 599, in extract
  File "yt_dlp\extractor\facebook.py", line 721, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 667, in _extract_from_url

... whereas (yt-dlp version 2021.12.01 [91f071a]):

yt-dlp_x86 -vF "https://www.facebook.com/RoeiFreilich/videos/2139244499701931/" => 

[debug] Command-line config: ['-vF', 'https://www.facebook.com/RoeiFreilich/videos/2139244499701931/']
[debug] Encodings: locale cp1253, fs utf-8, out utf-8 (No ANSI), err utf-8 (No ANSI), pref cp1253
[debug] yt-dlp version 2021.12.01 [91f071a] (win_exe)
[debug] Python version 3.7.9 (CPython 32bit) - Windows-Vista-6.0.6003-SP2
[debug] exe versions: none
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
[debug] [facebook] Extracting URL: https://www.facebook.com/RoeiFreilich/videos/2139244499701931/
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), acodec, filesize, fs_approx, tbr, vbr, abr, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 2139244499701931:
ID                              EXT RESOLUTION | PROTO | VCODEC  ACODEC
------------------------------------------------------------------------
progressive_sd_src              mp4 unknown    | https | unknown unknown
progressive_sd_src_no_ratelimit mp4 unknown    | https | unknown unknown

yt-dlp --add-header 'Sec-Fetch-Mode:' ... succeeds, with UA set to FF 89,

I can confirm here with latest yt-dlp-nightly, using as a test the link cited by @jheled :

yt-dlp -vF --user-agent "Mozilla/5.0 (Windows NT 6.1; rv:89.0) Gecko/20100101 Firefox/89.0" --add-header "Sec-Fetch-Mode:" "https://web.facebook.com/watch/?v=2139244499701931" => 

[debug] Command-line config: ['--ffmpeg-location', '..\\FFmpeg', '--downloader-args', 'ffmpeg:-v 8 -stats', '-vF', '--user-agent', 'Mozilla/5.0 (Windows NT 6.1; rv:89.0) Gecko/20100101 Firefox/89.0', '--add-header', 'Sec-Fetch-Mode:', 'https://web.facebook.com/watch/?v=2139244499701931']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.09.02.144028 [2301b5c1b] (win_x86_exe)
[debug] Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 1.1.1g  21 Apr 2020)
[debug] exe versions: ffmpeg n6.1-dev-1945-N-111829-g3c9dc0 (setts), ffprobe n6.1-dev-1945-N-111829-g3c9dc0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://web.facebook.com/watch/?v=2139244499701931
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 2139244499701931:
ID                              EXT RESOLUTION | PROTO | VCODEC  ACODEC
------------------------------------------------------------------------
progressive_sd_src              mp4 unknown    | https | unknown unknown
progressive_sd_src_no_ratelimit mp4 unknown    | https | unknown unknown

With this page yt-dl nightly gets:

[facebook] 2139244499701931: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 302: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Found (caused by HTTPError()) ....

But that's another problem.

Indeed, but as a workaround one can use a browser for the redirection:

https://web.facebook.com/watch/?v=2139244499701931 
=>
https://www.facebook.com/RoeiFreilich/videos/2139244499701931/

and then feed yt-dl that second FB URL:

yt-dl -vF "https://www.facebook.com/RoeiFreilich/videos/2139244499701931/" => 

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--ffmpeg-location', '.\\FFmpeg', '--external-downloader-args', '-v 8 -stats', '-vF', 'https://www.facebook.com/RoeiFreilich/videos/2139244499701931/']
[debug] Encodings: locale cp1253, fs mbcs, out cp737, pref cp1253
[debug] youtube-dl version 2023.08.07 [86e3cf5e5] (single file build)
[debug] ** This version was built from the latest master code at https://github.com/ytdl-org/youtube-dl.
[debug] ** For support, visit the main site.
[debug] Python 3.4.4 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 - OpenSSL 1.0.2d 9 Jul 2015
[debug] exe versions: ffmpeg n6.1-dev-1945-N-111829-g3c9dc0, ffprobe n6.1-dev-1945-N-111829-g3c9dc0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[facebook] 2139244499701931: Downloading webpage
[facebook] 2139244499701931: Downloading webpage
[info] Available formats for 2139244499701931:
format code                      extension  resolution note
progressive_sd_src               mp4        unknown
progressive_sd_src_no_ratelimit  mp4        unknown    (best)

@bashonly
Copy link
Member

bashonly commented Sep 4, 2023

but both these commits (in Jan 2022) were authored after v2021.12.25, which is now also broken in FB,

Then it was almost certainly d76d15a that broke the FB "Tahoe" fallback

@Vangelis66
Copy link

Then it was almost certainly d76d15a that broke the FB "Tahoe" fallback

Indeed it was! 👍 ; to sum it up:

The Tahoe API endpoint "fallback" in recent yt-dlp versions is broken because of:

  1. Update our chrome versions used for User-Agents; the cut-off Chrome version in this case is 77 (>=78 gets the door shut on its face 😞 ); "us" engaged in retrocomputing have a saying: "Newer isn't always better", which, I think, fits perfectly here 😜 ...
  2. [utils] Add Sec-Fetch-Mode to std_headers; this is worked-around by --add-header "Sec-Fetch-Mode:" (thanks @dirkf 😄 ).

Putting 1+2 into practice 😉, with latest yt-dlp-nightly:

yt-dlp -vF --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" --add-header "Sec-Fetch-Mode:" "https://www.facebook.com/gazzetta.gr/videos/1282182232423557/" => 

[debug] Command-line config: ['--ffmpeg-location', '..\\FFmpeg', '--downloader-args', 'ffmpeg:-v 8 -stats', '-vF', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36', '--add-header', 'Sec-Fetch-Mode:', 'https://www.facebook.com/gazzetta.gr/videos/1282182232423557/']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.09.04.183545 [69dbfe01c] (win_x86_exe)
[debug] Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 1.1.1g  21 Apr 2020)
[debug] exe versions: ffmpeg n6.1-dev-1945-N-111829-g3c9dc0 (setts), ffprobe n6.1-dev-1945-N-111829-g3c9dc0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.47.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://www.facebook.com/gazzetta.gr/videos/1282182232423557/
[facebook] 1282182232423557: Downloading webpage
[facebook] 1282182232423557: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 1282182232423557:
ID                       EXT RESOLUTION |   TBR PROTO | VCODEC          VBR ACODEC     ABR ASR MORE INFO
-------------------------------------------------------------------------------------------------------------------
309810111544885a         m4a audio only |   65k https | audio only          mp4a.40.5  65k 44k DASH audio, m4a_dash
dash_sd_src              mp4 unknown    |       https | unknown             unknown
dash_sd_src_no_ratelimit mp4 unknown    |       https | unknown             unknown
1345607079376096v        mp4 216x384    |  105k https | vp09.00.20.08  105k video only         DASH video, mp4_dash
1285943572038730v        mp4 360x640    |  182k https | av01.0.01M.08  182k video only         DASH video, mp4_dash
2905904322879782v        mp4 360x640    |  217k https | av01.0.01M.08  217k video only         DASH video, mp4_dash
332073845822799v         mp4 360x640    |  161k https | vp09.00.21.08  161k video only         DASH video, mp4_dash
276657805118621v         mp4 360x640    |  228k https | vp09.00.21.08  228k video only         DASH video, mp4_dash
1357980768469980v        mp4 540x960    |  333k https | av01.0.04M.08  333k video only         DASH video, mp4_dash
300477575999225v         mp4 540x960    |  367k https | vp09.00.30.08  367k video only         DASH video, mp4_dash
264187603137569v         mp4 720x1280   |  575k https | av01.0.05M.08  575k video only         DASH video, mp4_dash
828632058729309v         mp4 720x1280   |  553k https | vp09.00.31.08  553k video only         DASH video, mp4_dash
834065534700307v         mp4 720x1280   |  955k https | vp09.00.31.08  955k video only         DASH video, mp4_dash
dash_hd_src              mp4 720p       |       https | unknown             unknown
701716058436450v         mp4 900x1600   |  922k https | av01.0.08M.08  922k video only         DASH video, mp4_dash
279905904762370v         mp4 1080x1920  | 1556k https | av01.0.08M.08 1556k video only         DASH video, mp4_dash
1529796337425201v        mp4 1080x1920  | 1630k https | vp09.00.40.08 1630k video only         DASH video, mp4_dash

😃

@bashonly
Copy link
Member

bashonly commented Sep 4, 2023

I think there is more to the fingerprinting than just the headers, since I still get the error with the same command line on yt-dlp master. Or it could be a regional thing, maybe

@Vangelis66
Copy link

Have you tried (/are you able to try) with the yt-dlp_x86.exe binary? I can't try py>3.7 here at the moment 😉 ...

it could be a regional thing

I don't know whether that specific FB video is locked for non-Greek IPs; I tried several non-GR nodes in my VPN service: all fail; but then I realised every such node (server) has its own fingerprint when it faces the Tahoe API...

I let a Google search find a random Facebook video, e.g.

https://www.facebook.com/OfficialRandomVideos/videos/gas-station-fails-compilation-preview/536547506527068

and that one works, too, with yt-dlp_x86.exe and the Ch77 UA:

yt-dlp -vF --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" --add-header "Sec-Fetch-Mode:" "https://www.facebook.com/OfficialRandomVideos/videos/gas-station-fails-compilation-preview/536547506527068" => 

[debug] Command-line config: ['--ffmpeg-location', '..\\FFmpeg', '--downloader-args', 'ffmpeg:-v 8 -stats', '-vF', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36', '--add-header', 'Sec-Fetch-Mode:', 'https://www.facebook.com/OfficialRandomVideos/videos/gas-station-fails-compilation-preview/536547506527068']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.09.04.183545 [69dbfe01c] (win_x86_exe)
[debug] Python 3.7.9 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 1.1.1g  21 Apr 2020)
[debug] exe versions: ffmpeg n6.1-dev-1945-N-111829-g3c9dc0 (setts), ffprobe n6.1-dev-1945-N-111829-g3c9dc0, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.47.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://www.facebook.com/OfficialRandomVideos/videos/gas-station-fails-compilation-preview/536547506527068
[facebook] 536547506527068: Downloading webpage
[facebook] 536547506527068: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 536547506527068:
ID                       EXT RESOLUTION |  TBR PROTO | VCODEC       VBR ACODEC   ABR ASR MORE INFO
---------------------------------------------------------------------------------------------------------------------
1698545660382577a        m4a audio only |  49k https | audio only       mp4a.40.29 49k 48k [eng] DASH audio, m4a_dash
dash_sd_src              mp4 unknown    |      https | unknown          unknown
dash_sd_src_no_ratelimit mp4 unknown    |      https | unknown          unknown
684531790355612v         mp4 426x240    |  49k https | avc1.4D401E  49k video only         DASH video, mp4_dash
232167923066388v         mp4 480x270    | 103k https | avc1.4D401E 103k video only         DASH video, mp4_dash
794172132156124v         mp4 640x360    | 232k https | avc1.4D401E 232k video only         DASH video, mp4_dash
6381808691895407v        mp4 1280x720   | 847k https | avc1.4D401F 847k video only         DASH video, mp4_dash
dash_hd_src              mp4 720p       |      https | unknown          unknown

@bashonly
Copy link
Member

bashonly commented Sep 5, 2023

Have you tried (/are you able to try) with the yt-dlp_x86.exe binary?

I don't have a windows machine that I can test with

I don't know whether that specific FB video is locked for non-Greek IPs;

The video wasn't geo-restricted; what I meant is that maybe FB serves different html to different regions. There are a few values needed for the Tahoe request that are sourced from the initial webpage response:

            tahoe_data = self._download_webpage(
                self._VIDEO_PAGE_TAHOE_TEMPLATE % video_id, video_id,
                data=urlencode_postdata({
                    '__a': 1,
                    '__pc': self._search_regex(
                        r'pkg_cohort["\']\s*:\s*["\'](.+?)["\']', webpage,
                        'pkg cohort', default='PHASED:DEFAULT'),
                    '__rev': self._search_regex(
                        r'client_revision["\']\s*:\s*(\d+),', webpage,
                        'client revision', default='3944515'),
                    'fb_dtsg': self._search_regex(
                        r'"DTSGInitialData"\s*,\s*\[\]\s*,\s*{\s*"token"\s*:\s*"([^"]+)"',
                        webpage, 'dtsg token', default=''),
                }),
                headers={
                    'Content-Type': 'application/x-www-form-urlencoded',
                })

Anyways, I will be merging the FB PR to close the other issue shortly. I was hoping to figure this out as well, but I've tried everything and can't reproduce the successful response on my end. So I'm just giving a heads up that this Tahoe issue is about to become impossible to debug with master/nightly (you'll need to use an old nightly build, or modify the source to force the fallback to the Tahoe request).

@jheled

This comment was marked as off-topic.

@renandecarlo

This comment was marked as off-topic.

@Vangelis66
Copy link

this Tahoe issue is about to become impossible to debug with master/nightly (you'll need to use an old nightly build

... For anyone still interested 😉 , the very last yt-dlp-nightly release without #7890 merged is 2023.09.05.200110 ...

I was hoping to figure this out as well, but I've tried everything
and can't reproduce the successful response on my end

Last night I did continue my tests, this time using some experimental yt-dlp_x86.exe builds, compiled with modded CPython 3.8/3.9 (so as to launch even on NT 5.1 😉 ) and modded OpenSSL-3.1.0 lib, and I still found that adding:

--user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" --add-header "Sec-Fetch-Mode:"

to my commands did make the Tahoe API "happy" 😜 ; as a test, I used the TEST 'url' inside #7890,

https://www.facebook.com/radiokicksfm/videos/3676516585958356/

CPython 3.8.13+OpenSSL-3.1.0-dev
yt-dlp_x86 -vF "https://www.facebook.com/radiokicksfm/videos/3676516585958356/" => 

[debug] Command-line config: ['-vF', 'https://www.facebook.com/radiokicksfm/videos/3676516585958356/']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.08.31 [7237c8dca] (win_x86_exe)
[debug] Python 3.8.13+ (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 3.1.0-dev )
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://www.facebook.com/radiokicksfm/videos/3676516585958356/
[facebook] 3676516585958356: Downloading webpage
[facebook] 3676516585958356: Downloading webpage
ERROR: [facebook] 3676516585958356: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 715, in extract
  File "yt_dlp\extractor\facebook.py", line 733, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 680, in _extract_from_url

but

yt-dlp_x86 -vF --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" --add-header "Sec-Fetch-Mode:" "https://www.facebook.com/radiokicksfm/videos/3676516585958356/ => 

[debug] Command-line config: ['-vF', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36', '--add-header', 'Sec-Fetch-Mode:', 'https://www.facebook.com/radiokicksfm/videos/3676516585958356/']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.08.31 [7237c8dca] (win_x86_exe)
[debug] Python 3.8.13+ (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 3.1.0-dev )
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://www.facebook.com/radiokicksfm/videos/3676516585958356/
[facebook] 3676516585958356: Downloading webpage
[facebook] 3676516585958356: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 3676516585958356:
ID                EXT RESOLUTION |  TBR PROTO | VCODEC       VBR ACODEC     ABR ASR MORE INFO
--------------------------------------------------------------------------------------------------------
998172518084032a  m4a audio only |  65k https | audio only       mp4a.40.5  65k 48k DASH audio, m4a_dash
dash_sd_src       mp4 unknown    |      https | unknown          unknown
673954957623594v  mp4 276x144    |  45k https | avc1.4D400C  45k video only    DASH video, mp4_dash
329723412734958v  mp4 460x240    |  96k https | avc1.4D4015  96k video only    DASH video, mp4_dash
1334094473848775v mp4 690x360    | 200k https | avc1.4D401E 200k video only    DASH video, mp4_dash
266105879550722v  mp4 920x480    | 333k https | avc1.4D401F 333k video only    DASH video, mp4_dash
682373210155474v  mp4 1380x720   | 606k https | avc1.4D4020 606k video only    DASH video, mp4_dash
CPython 3.9.13+OpenSSL-3.1.0-dev
yt-dlp_x86 -vF "https://www.facebook.com/radiokicksfm/videos/3676516585958356/" => 

[debug] Command-line config: ['-vF', 'https://www.facebook.com/radiokicksfm/videos/3676516585958356/']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.08.31 [7237c8dca] (win_x86_exe)
[debug] Python 3.9.13 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 3.1.0-dev )
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://www.facebook.com/radiokicksfm/videos/3676516585958356/
[facebook] 3676516585958356: Downloading webpage
[facebook] 3676516585958356: Downloading webpage
ERROR: [facebook] 3676516585958356: Cannot parse data; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
  File "yt_dlp\extractor\common.py", line 715, in extract
  File "yt_dlp\extractor\facebook.py", line 733, in _real_extract
  File "yt_dlp\extractor\facebook.py", line 680, in _extract_from_url

but

yt-dlp_x86 -vF --user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36" --add-header "Sec-Fetch-Mode:" "https://www.facebook.com/radiokicksfm/videos/3676516585958356/ => 

[debug] Command-line config: ['-vF', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36', '--add-header', 'Sec-Fetch-Mode:', 'https://www.facebook.com/radiokicksfm/videos/3676516585958356/']
[debug] Encodings: locale cp1253, fs utf-8, pref cp1253, out utf-8 (No VT), error utf-8 (No VT), screen utf-8 (No VT)
[debug] yt-dlp version nightly@2023.08.31 [7237c8dca] (win_x86_exe)
[debug] Python 3.9.13 (CPython x86 32bit) - Windows-Vista-6.0.6003-SP2 (OpenSSL 3.1.0-dev )
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, sqlite3-2.6.0, websockets-11.0.3
[debug] Proxy map: {}
[debug] Loaded 1864 extractors
[facebook] Extracting URL: https://www.facebook.com/radiokicksfm/videos/3676516585958356/
[facebook] 3676516585958356: Downloading webpage
[facebook] 3676516585958356: Downloading webpage
[debug] Sort order given by extractor: res, quality
[debug] Formats sorted by: hasvid, ie_pref, res, quality, lang, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 3676516585958356:
ID                EXT RESOLUTION |  TBR PROTO | VCODEC       VBR ACODEC     ABR ASR MORE INFO
--------------------------------------------------------------------------------------------------------
998172518084032a  m4a audio only |  65k https | audio only       mp4a.40.5  65k 48k DASH audio, m4a_dash
dash_sd_src       mp4 unknown    |      https | unknown          unknown
673954957623594v  mp4 276x144    |  45k https | avc1.4D400C  45k video only    DASH video, mp4_dash
329723412734958v  mp4 460x240    |  96k https | avc1.4D4015  96k video only    DASH video, mp4_dash
1334094473848775v mp4 690x360    | 200k https | avc1.4D401E 200k video only    DASH video, mp4_dash
266105879550722v  mp4 920x480    | 333k https | avc1.4D401F 333k video only    DASH video, mp4_dash
682373210155474v  mp4 1380x720   | 606k https | avc1.4D4020 606k video only    DASH video, mp4_dash

that maybe FB serves different html to different regions.

Sadly 😢 , I can't test your theory about FB serving different page sources in different parts of the globe, as any attempt to use a VPN node/HTTPS Proxy (to "move out" of my region 😜 ) has resulted in a Tahoe API block 😠 ...

@jingtra
Copy link
Contributor

jingtra commented Nov 20, 2023

Hi!

I have been looking into this, and Facebook would consistently return "RelayPrefetchedStreamCache\u00406fa52080e4dc537033301a17dbec99b5" instead of "RelayPrefetchedStreamCache". I fixed it by modifying the facebook function a little:

def extract_relay_prefetched_data(_filter):
return traverse_obj(extract_relay_data(_filter), (
'require', (None, (..., ..., ..., '__bbox', 'require')),
lambda _, v: any(key.startswith('RelayPrefetchedStreamCache') for key in v if isinstance(key, str)), ..., ...,
'__bbox', 'result', 'data', {dict}), get_all=False) or {}

@life777eternal
Copy link

life777eternal commented Jan 8, 2024

Greetings, how does a person download Facebook videos that are only available for registered users? (such as those shared directly on a private group.)

C:\Users\+++++++\Downloads>yt-dlp.exe https://fb.watch/ps73RVDKQy/ [generic] Extracting URL: https://fb.watch/ps73RVDKQy/ [generic] ps73RVDKQy: Downloading webpage [redirect] Following redirect to https://www.facebook.com/watch/?v=285133124181047&ref=sharing [facebook] Extracting URL: https://www.facebook.com/watch/?v=285133124181047&ref=sharing [facebook] 285133124181047: Downloading webpage ERROR: [facebook] 285133124181047: This video is only available for registered users. Use --cookies, --cookies-from-browser, --username and --password, --netrc-cmd, or --netrc (facebook) to provide account credentials

--username and --password doesn't work when I have the 2FA on, and the cookies from browser is denied.

C:\Users\+++++++\Downloads>yt-dlp.exe --cookies-from-browser brave https://fb.watch/ps73RVDKQy/ Extracting cookies from brave Traceback (most recent call last): File "yt_dlp\__main__.py", line 17, in <module> File "yt_dlp\__init__.py", line 1009, in main File "yt_dlp\__init__.py", line 963, in _real_main File "yt_dlp\YoutubeDL.py", line 687, in __init__ File "yt_dlp\YoutubeDL.py", line 4128, in build_request_director File "functools.py", line 967, in __get__ File "yt_dlp\YoutubeDL.py", line 4049, in cookiejar File "yt_dlp\cookies.py", line 91, in load_cookies File "yt_dlp\cookies.py", line 112, in extract_cookies_from_browser File "yt_dlp\cookies.py", line 281, in _extract_chrome_cookies File "yt_dlp\cookies.py", line 1042, in _open_database_copy File "shutil.py", line 418, in copy File "shutil.py", line 264, in copyfile PermissionError: [Errno 13] Permission denied: 'C:\\Users\\+++++++\\AppData\\Local\\BraveSoftware\\Brave-Browser\\User Data\\Default\\Network\\Cookies' [13972] Failed to execute script '__main__' due to unhandled exception!

C:\Users\+++++++\Downloads>

Thank you.

@bashonly bashonly mentioned this issue Jan 11, 2024
11 tasks
@ringus1
Copy link
Contributor

ringus1 commented Jan 11, 2024

Hi!

I have been looking into this, and Facebook would consistently return "RelayPrefetchedStreamCache\u00406fa52080e4dc537033301a17dbec99b5" instead of "RelayPrefetchedStreamCache". I fixed it by modifying the facebook function a little:

def extract_relay_prefetched_data(_filter): return traverse_obj(extract_relay_data(_filter), ( 'require', (None, (..., ..., ..., '__bbox', 'require')), lambda _, v: any(key.startswith('RelayPrefetchedStreamCache') for key in v if isinstance(key, str)), ..., ..., '__bbox', 'result', 'data', {dict}), get_all=False) or {}

That indeed seem to solve some of the cases if not all. :)

@bashonly
Copy link
Member

some additional info about the tahoe endpoint: #542 (comment)

bashonly pushed a commit that referenced this issue Feb 15, 2024
Partially addresses #4311

Authored by: jingtra, ringus1

Co-authored-by: Jing Kjeldsen <jingtra@gmail.com>
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
Partially addresses yt-dlp#4311

Authored by: jingtra, ringus1

Co-authored-by: Jing Kjeldsen <jingtra@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-share-account Someone is willing to provide account details for development regression Works in youtube-dl/older yt-dlp site-bug Issue with a specific website
Projects
Status: No status
Status: facebook
Development

Successfully merging a pull request may close this issue.