Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

read-browser-cookies

magicdawn64MIT0.2.0TypeScript support: included

Node.js version of --cookies-from-browser from yt-dlp

cookies-from-browser, browser-cookies, yt-dlp, chrome-cookies

readme

read-browser-cookies

Node.js version of --cookies-from-browser from yt-dlp

Build Status Coverage Status npm version npm downloads npm license

Install

$ pnpm add read-browser-cookies

Alternative

I'm surprised yt-dlp's usage, and create this pkg, then I found these existing alternative pkgs

Status

  • <input checked="" disabled="" type="checkbox"> macOS + Chromium Based browsers
  • <input disabled="" type="checkbox"> macOS + safari
  • <input disabled="" type="checkbox"> macOS + firefox
  • <input disabled="" type="checkbox"> windows + Chromium Based browsers
  • <input disabled="" type="checkbox"> windows + firefox
  • <input disabled="" type="checkbox"> Linux + Chromium Based browsers
  • <input disabled="" type="checkbox"> Linux + firefox

current only macOS + Chromium based browsers are supported.

chromium based browser names

  • chrome
  • chromium
  • edge
  • brave
  • opera
  • vivaldi

API

import { readBrowserCookies } from 'read-browser-cookies'

// read all cookies
readBrowserCookies('chrome').then((cookiesArray) => {
  //
})

// read all cookies for specific site
// using sqlite `like %site%`
readBrowserCookies('chrome', { site: 'youtube.com' }).then((cookiesArray) => {
  //
})

Changelog

CHANGELOG.md

License

the MIT License http://magicdawn.mit-license.org

changelog

CHANGELOG

v0.2.0 2022-12-16

  • feat: add readCookies / readCookiesStr export

v0.1.1 2022-12-12

  • feat: process chrome special timestamp

v0.1.0 2022-12-11

  • feat: export ICookie & chromiumBrowsers
  • feat: use sql parameters

v0.0.3 2022-12-11

  • add readme
  • fix some types

v0.0.2 2022-12-11

  • camelCase everything
  • remove internal console.log

v0.0.1 2022-12-11

  • first release, only mac + chromium based browsers are supported.