$ uname -a
Linux debian 5.10.0-18-amd64 #1 SMP Debian 5.10.140-1 (2022-09-02) x86_64 GNU/Linux
$ which brave-browser
/usr/bin/brave-browser
$ brave-browser --version
Brave Browser 128.1.71.16 nightly
~
and brave-browser seems to be at: /opt/brave.com/brave-nightly/brave-browser-nightly
$ pwd
/usr/bin
$ which brave-browser
/usr/bin/brave-browser
$ ls -l /usr/bin/brave-browser
lrwxrwxrwx 1 root root 31 Dec 22 04:36 /usr/bin/brave-browser → /etc/alternatives/brave-browser
$ ls -l /etc/alternatives/brave-browser
lrwxrwxrwx 1 root root 30 Dec 22 04:36 /etc/alternatives/brave-browser → /usr/bin/brave-browser-nightly
$ ls -l /usr/bin/brave-browser-nightly
lrwxrwxrwx 1 root root 50 Aug 20 09:18 /usr/bin/brave-browser-nightly → /opt/brave.com/brave-nightly/brave-browser-nightly
$ ls -l /opt/brave.com/brave-nightly/brave-browser-nightly
-rwxr-xr-x 1 root root 1544 Aug 20 09:18 /opt/brave.com/brave-nightly/brave-browser-nightly
~
but I wasn’t able to instruct brave to load the cookies because I can’t find where brave keeps them:
_DIR=“/home/user”
find “${_DIR}” -type d -name “.config”
_DIR=“/opt/brave.com/brave-nightly/brave-browser-nightly”
find “${_DIR}” -type d -name “.config”
$ ./yt-dlp --cookies-from-browser brave MG_UzMTh82w
Extracting cookies from brave
ERROR: could not find brave cookies database in “/home/user/.config/BraveSoftware/Brave-Browser”
I’ve never used yt-dlp before, so if there’s a config file, mine is the default. It finds the cookies but can’t decrypt all of them. I would use the keyring option to see if that fixes it, but can’t work out how to.
$ yt-dlp --cookies-from-browser brave MG_UzMTh82w
Extracting cookies from brave
[Cookies] Loading cookie 0/ 1175
WARNING: failed to decrypt cookie (AES-CBC) because UTF-8 decoding failed.
Possibly the key is wrong?
Extracted 765 cookies from brave (409 could not be decrypted)
The only way to specify a cookie location is by using a netscape-formatted file, which I do not believe Chrome browsers have, in which case your problem is something other than knowing the location of the cookies.
From the yt-dlp docs: --cookies FILE Netscape formatted file to read cookies from and dump cookie jar in
since you have never used yt-dlp, a config file used by brave browser you meant, right? Which options on it help while trying to solve that problem? Basically, where the IndexedDB data is kept and whatever other data is needed to access it.
Hmm! What do you mean? So, session cookies are encrypted on the server end and placed on the clients? In such cases, I would say, just sending them back to the server is all you would need to care about, no?
I am sure someone has delved into those matters more deeply. Going “Settings” > “More tools” > “Applications” and expanding the “Cookies” tree, I can see all the cookies associated with the youtube.com domain. They all seem to be plain text and the fields/column definitions of the IndexedDB data are straight forward. There should be an easy way to extract that data from that DB and convert it into a netscape-formatted file.
Or, there should be an easier way to do that using brave. Is there a way to paste a bunch of youtube uris and have brave download all the data and place in a local directory in an automated fashion probably instrumented through Selenium?
I mentioned the config file because without it ever being changed, yt-dlp has no problem finding the cookies. So if you’ve changed something there, unchange it. I did not mean the browser config file, I meant the yt-dlp one.
The cookies are encrypted on the client, which is why there is a command line option in yt-dlp to decrypt them. A cookie encrypted on the server could be stolen and sent by any client without needing the encryption key, thus negating any benefit of encryption.
You can probably create a netscape-formatted cookies file based on the data you found in Brave Settings, and you can download youtube videos by concatenating all the fetched files whose name starts with “videoplayback”. But seeing as yt-dlp works out of the box and does not need to be told the answer to the question in this thread’s title, I would simply delete the config file and run the usual command.
this is what I see:
Profile Path /home/user/.config/BraveSoftware/Brave-Browser-Nightly/Default
I don’t see the picture you included.
Also, as weird as it may sound, I kept probing this issue and I discovered that youtube apparently doesn’t like when you try to set the “–format <format id>” option. I have no idea why they would do this. Probably for “security reasons” or because the webp file format somehow includes calls home? or whatever. I don’t need all pictures to be HD. I actually like the mp4 format because at times I need to use those videos where I teach and I have noticed that, since most social settings have Windows installed, they all seem to like mp4.
@lbrtchx the picture they showed was supposed to be a thing to show what each area holds. Was supposed to be something of a sheet to try to learn to navigate things. That said, a lot of things they share usually is an overwhelming amount of information and often is more educational for related issues and not anything that leads to an immediate solution for the problem at hand.
Right, so once you’re there, it shows you everything that’s in Brave. You could just search at that point for cookies or whatever. For example, going from Windows, my profile path is C:\Users\saoir\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default
I did a search for cookies and found it’s under Network
Btw, I’m going to tag in @Mattches. He should be coming back after the weekend. He’ll have a lot to catch up on but hoping maybe he’ll be able to see and give better information based on your initial concern and everything else.
OK, here are two features I would love to see implemented in “brave” when you guys come back ;-):
an option to download links locally reflecting as best as it could the link based on the URL (not all URL could be straightforwardly rewritten into a path) and all links on the pages should be rewritten as relative links (browsers do that anyway, I am asking for it to be more customizable). If user just klick on a link the temp cache should be used if it keeps the more over a link for, say, a second then after the file is downloaded when you click on it, it should be kept in a sub directory determined by the user, e.g.:
at times subdomains parsing get messy, so who is may be needed.
1.1) user chooses in the configuration file where in their local fs do they want the downloads (instead of using a temporary “cache” folder)
1.2) doing your actual work in an air-gapped computer has become a thing; so, user should be even able to keep some files off line and update and import a list with the files being kept off line
2) there should be an option to, if not totally, semi automate the download of a bunch of files in a batch of URLs
lbrtchx
As @289wk stated, cookies are in the user data profile folder. Follow the path shown in brave://version on your system and you should see a Cookies file right there. Here’s how it looks on macOS:
So those are all that show up at C:\Users\saoir\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default which is my profile path.
Searching for cookies had me either going to Extension Cookies or to Network and then Cookies. Not sure which is more accurate. But that’s on Windows 11 Pro and Brave 1.73.104