npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bird-auth

v2.5.1

Published

get cookie and then you can use it with birdv1

Downloads

48

Readme

bird-auth

NPM Version NODE Version OSX Build LINUX Build

解决 birdv1 版本手动取cookie问题, 支持网易云音乐、百度认证。

Install

npm install --save-dev bird-auth

API

birdAuth

| name | api | instance function | | :----- | :----- | :----- | | client | client[fn] | not support | | baidu.uuap | birdAuth.baidu.uuap(options[, callback]) | retry, getCookie | | baidu.passport| birdAuth.baidu.passport(options[, callback]) | getCookie | | netease.music| birdAuth.netease.music(options[, callback]) | retry, getCookie, aesEncrypt |

client

| method | demo | detail | | :----- | :-- | :----- | | url_get | client.url_get(url, callback) | get method(no cookie) | | get | client.get(url, callback) | get method(with cookie) | | post | client.post(options, callback) | post method(with cookie) | | get_cookies_string | client.get_cookies_string() | get all cookies | | update_cookies | client.update_cookies(cookies, true) | update new cookies | | set_cookies | client.set_cookies(cookies, true) | set new cookies | | clear_cookies | client.clear_cookies() | remove all cookies |

Command Line

usage: bird -u xxx -p xxx -t netseae_music

Options:
  -h, --help      Show help                                           [boolean]
  -t, --type      baidu_uuap, baidu_passport, netease_music           [default: "baidu_uuap"]
  -u, --username  username                                            [required]
  -p, --password  password                                            [required]
  -s, --server    server(baidu_uuap need it), if you don't know this, you can logout you system and get url.

Examples

baidu uuap auth

const birdAuth = require('bird-auth')
const uuap = new birdAuth.baidu.uuap({
    username: 'xxx',
    password: 'xxx',
    type: 3, // default 1 is username and password; 3 is username and verification code.
    uuapServer: 'http://xxx.baidu.com/login', // CAS auth url 
    service: 'http://xxx.baidu.com/' // service address, if you don't know this url, you can logout you system, and get `service` parameters
}, function(cookie) {
    console.log(cookie)
});

uuap.retry({
    username: 'xxx',
    password: 'xxx',
    uuapServer: 'http://xxx.baidu.com/login',
    service: 'http://xxx.baidu.com/'
});

baidu passport auth

const birdAuth = require('bird-auth')
const passport = new birdAuth.baidu.passport({
    username: 'xxx',
    password: 'xxx',
    service: 'https://passport.baidu.com/v2/?login' //default passport.baidu.com
}, function(cookie) {
    console.log(cookie)
});

netease music auth

const birdAuth = require('bird-auth')
const music = new birdAuth.netease.music({
    username: 'xxx', // phone number or mail
    password: 'xxx'
}, function(cookie) {
    console.log(cookie)
});

History

  • [2.5.0] remove querystring package.
  • [2.4.1] fix url check method.
  • [2.4.0] switch login to authorize.
  • [2.3.1] add type option to auth parameter.
  • [2.3.0] fix token verification mechanism.
  • [2.2.1] modify parameter naming.
  • [2.2.0] change login to authorize.
  • [2.1.0] remove service params.
  • [2.0.0] refactor & update auth.
  • [1.2.8] add auth rsa check.
  • [1.2.7] add client.set_cookies & client.clear_cookies method.
  • [1.2.5] add client.update_cookies method.
  • [1.2.4] fix passport test(qatest/rdtest) auth bug.
  • [1.2.0] group auth and add netease music auth.
  • [1.1.10] add httpClient Content-Type adjust.
  • [1.1.9] fix passport agent.
  • [1.1.6] Fixup 302 response location is not a normal url 😂
  • [1.1.3] Custom agent to fix https authorized bug. :(
  • [1.1.0] Add bird-auth command, you can use bird-auth -h to see more :)
  • [1.0.6] Fixed get_cookies_string bug
  • [1.0.5] Fixed Syntax Error
  • [1.0.4] Fixed passport auth bugfix
  • [1.0.3] Project init

Future

  • refactor with typescript.
  • optimize function, remove useless code.
  • Change account and get cookie afresh
  • Support Https
  • Support online Passport auth
  • Set rejectUnauthorized false and fix uuap auth bug. detail
  • Add bprouting support
  • statusCode === 302 judgment