https://github.com/magicdawn/read-browser-cookies
Node.js version of `--cookies-from-browser` from yt-dlp
https://github.com/magicdawn/read-browser-cookies
Last synced: 3 months ago
JSON representation
Node.js version of `--cookies-from-browser` from yt-dlp
- Host: GitHub
- URL: https://github.com/magicdawn/read-browser-cookies
- Owner: magicdawn
- License: mit
- Created: 2022-12-09T14:42:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-22T20:15:57.000Z (over 2 years ago)
- Last Synced: 2024-12-12T08:20:16.203Z (over 1 year ago)
- Language: TypeScript
- Size: 431 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# read-browser-cookies
> Node.js version of `--cookies-from-browser` from yt-dlp
[](https://github.com/magicdawn/read-browser-cookies/actions/workflows/ci.yml)
[](https://codecov.io/gh/magicdawn/read-browser-cookies)
[](https://www.npmjs.com/package/read-browser-cookies)
[](https://www.npmjs.com/package/read-browser-cookies)
[](http://magicdawn.mit-license.org)
## Install
```sh
$ pnpm add read-browser-cookies
```
## Alternative
I'm surprised yt-dlp's usage, and create this pkg, then I found these existing alternative pkgs
- https://github.com/bertrandom/chrome-cookies-secure
- https://github.com/phoqe/havelock
## Status
- [x] macOS + Chromium Based browsers
- [ ] macOS + safari
- [ ] macOS + firefox
- [ ] windows + Chromium Based browsers
- [ ] windows + firefox
- [ ] Linux + Chromium Based browsers
- [ ] Linux + firefox
current only macOS + Chromium based browsers are supported.
#### chromium based browser names
- chrome
- chromium
- edge
- brave
- opera
- vivaldi
## API
```js
import { readCookies, readCookiesStr } from 'read-browser-cookies'
// read all cookies
readCookies('chrome').then((cookiesArray) => {
//
})
// read all cookies for specific site
readCookies('chrome', { site: 'youtube.com' }).then((cookiesArray) => {
//
})
// read all cookies for specific site, as string
readCookiesStr('chrome', { site: 'youtube.com' }).then((cookiesStr) => {
// request.get(url, { headers: { cookie: cookiesStr } })
})
```
## Changelog
[CHANGELOG.md](CHANGELOG.md)
## License
the MIT License http://magicdawn.mit-license.org